# references: # https://github.com/LukeSmithxyz/mutt-wizard # https://wiki.archlinux.org/title/Mutt # https://videos.lukesmith.xyz/ # https://docs.kernel.org/process/email-clients.html # https://blog.flaport.net/configuring-neomutt-for-email.html # maybe useful: # `man neomuttrc` # `man neomutt` # /etc/neomutt # https://neomutt.org/guide/gettingstarted.html # /usr/share/doc/neomutt/optionalfeatures.html # has hotkey documentation: # /usr/share/doc/neomutt/manual.txt # realname and spoolfile deprecated, use real_name and spool_file, also some other variable names, see: # https://github.com/neomutt/neomutt/commit/a5eaeb51b14c484fa52f6f519446253dea5667ca source mail2 # maybe useful for multiple accounts #folder-hook $folder 'source mail2' source mail #folder-hook $folder 'source mail' # note the imaps:// and smtps://, maybe more secure? # note: xyz@flylightning.xyz will not work, need mail.flylightning.xyz, maybe because they require the actual imaps and smtps email server DNS #set smtp_url='smtps://xyz@mail.flylightning.xyz' # mbox_type not sure if needed, maybe needed because isync/mbsync set to use maildir format set mbox_type=Maildir #set folder="$XDG_DATA_HOME/mail/xyz@mail.flylightning.xyz" # if fully online and not using mbsync: #set folder='imaps://xyz@mail.flylightning.xyz' # https://wiki.archlinux.org/title/Mutt#Pass # need "" instead of ''? # Just `pass show xxx` also works. My xxx password also has lines of other info I do not want to output # credit: GPL-2.0-or-later https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu # pipe to `head -n1` also works, it seems it will auto strip out \n newline char? set imap_pass="`pass show master3 | { IFS= read -r p; printf %s \"$p\";}`" set smtp_pass="`pass show master3 | { IFS= read -r p; printf %s \"$p\";}`" set from='xyz@flylightning.xyz' # /etc/neomuttrc says if use from var this will not use? not sure if works set real_name='Xiao Pan' # this seems also determines sidebar mailbox order #mailboxes =INBOX =Sent =Drafts =Archive =Junk =Trash # if fully online and use `set folder="imaps://xyz@mail.flylightning.xyz"` instead: # default not auto subscribe to inbox? need `mailboxes =INBOX` at least #mailboxes =INBOX #set imap_check_subscribed # spool_file not sure if needed # + seems mean remote? set spool_file='+INBOX' set record='+Sent' set trash='+Trash' set postponed='+Drafts' # `man neomuttrc.5` says "Header caching can greatly improve speed when ..." set header_cache="$XDG_CACHE_HOME/mutt" set message_cache_dir="$XDG_CACHE_HOME/mutt" # Allow Mutt to open a new IMAP connection automatically. unset imap_passive set attach_save_dir="$XDG_DOWNLOAD_DIR" set attach_save_without_prompting # linux kernel mailing list rules: set send_charset="us-ascii:utf-8" # Sender, email address, and sign-off line must match # because joe@localhost is just embarrassing unset use_domain # about pgp: #auto_view application/pgp-encrypted # maybe use account-hook or folder-hook to `unset crypt_auto_sign` for accounts I do not wish to auto sign set crypt_auto_sign set pgp_default_key='FDA389A17B94BCE0E2FA3D71842BFD347BE06812' # maybe useful: crypt_opportunistic_encrypt, crypt-hook # https://neomutt.org/guide/gettingstarted#2-4-%C2%A0sidebar set sidebar_visible set sidebar_width=20 # manpage suggested # %<... is nested if, see https://neomutt.org/feature/nested-if set sidebar_format='%B%%* %%S' set sidebar_short_path # needed for some sidebar features set mail_check_stats # to avoid lags using IMAP with some email providers (yahoo for example) set mail_check=60 # no ask auto save to draft set postpone='yes' # need echo here to run an external shell command, see https://neomutt.org/feature/global-hooks # startup-hook works, but I'm not confidient with it because shutdown-hook is buggy, see below. Because I'll need a wrapper script for mbsync after shutdown, I decided to just use a wrapper script for mbsync before startup also for now #startup-hook 'echo `mbsync -a`' # I decided not to use timeout-hook and shutdown-hook hooks due to its issues with mbsync, see below # timeout-hook and shutdown-hook configured with startup-hook will cause timeout-hook and shutdown-hook mbsync not working? see https://github.com/neomutt/neomutt/issues/3298 , my experience is shutdown-hook's mbsync not working, not sure how to test timeout-hook # somehow `sleep 1; mbsync -a` works? # maybe related: https://github.com/neomutt/neomutt/issues/4184 https://github.com/neomutt/neomutt/pull/4200 # more bug notes see vq # consider I may use another email client to access remote email mailboxes, sync when shutdown so those other email client can get latest changes #shutdown-hook 'echo `mbsync -a`' # I don't understand timeout-hook and $timeout very well, but seems useful, $timeout default 600 seconds, so maybe it sync every 600s #timeout-hook 'echo `mbsync -a`' # no prompt for deleting emails set delete=yes # no prompt for moving emails set confirm_append=no # man neomuttrc, query_command: "NeoMutt will add quotes around the string # substituted for "%s" automatically according to shell quoting rules, so you # should avoid adding your own. If no "%s" is found in the string, NeoMutt will # append the user's query to the end of the string." set query_command="abook --mutt-query" # https://neomutt.org/guide/advancedusage#8-%C2%A0external-address-queries # completion when ask for address input # default ^T # another way is Q, it will let me select an address from abook and start a new email bind editor complete-query # email from insp to ca mail server to others will have "Received: from xyzinsp.mynetworksettings.com" in email header, VPN only change IP but not this auto-detected hostname by neomutt, if privacy is a concern for future anonymous email server, set hostname=..., e.g.: #set hostname='anonymous' # maybe: # maybe, from mutt-wizard: # maybe add configs from mutt-wizard: # - add Maildir configs? see arch wiki and mutt-wizard, not fully understood # - mime type configs # - other configs # seems not working with this: #set smtp_authenticators='gssapi:login' #set forward_attachments=yes #set forward_format = "Fwd: %s" # can configure mailcap configs ~/.mailcap to use lynx to auto show html with lynx #auto_view text/html # https://blog.flaport.net/configuring-neomutt-for-email.html # https://github.com/LukeSmithxyz/mutt-wizard/blob/master/share/mutt-wizard.muttrc # M default to show-log-messages, can be executed by `:exec show-log-messages` bind index,pager M noop # C deafult to copy-message bind index,pager C noop # g default to group-reply bind index,pager g noop bind index,pager R group-reply bind index,pager i noop macro index,pager \'a "=Archive" "go to archive" macro index,pager \'d "=Drafts" "go to drafts" macro index,pager \'i "=INBOX" "go to inbox" macro index,pager \'j "=Junk" "go to junk" macro index,pager \'s "=Sent" "go to sent" macro index,pager \'t "=Trash" "go to trash" macro index,pager Ca ";=Archive" "copy mail to archive" macro index,pager Cd ";=Drafts" "copy mail to drafts" macro index,pager Ci ";=INBOX" "copy mail to inbox" macro index,pager Cj ";=Junk" "copy mail to junk" macro index,pager Cs ";=Sent" "copy mail to sent" macro index,pager Ct ";=Trash" "copy mail to trash" macro index,pager Ma ";=Archive" "move mail to archive" macro index,pager Md ";=Drafts" "move mail to drafts" macro index,pager Mi ";=INBOX" "move mail to inbox" macro index,pager Mj ";=Junk" "move mail to junk" macro index,pager Ms ";=Sent" "move mail to sent" macro index,pager Mt ";=Trash" "move mail to trash" # here must specify full path of the file to source, else it will souce in the dir where neomutt is execute at macro index,pager ia 'source "$XDG_CONFIG_HOME/neomutt/mail"!' macro index,pager ib 'source "$XDG_CONFIG_HOME/neomutt/mail2"!' # maybe useful for multiple accounts #macro index c "?^K=" macro index S "mbsync -a" "sync email" bind index L limit bind attach l view-mailcap bind pager l view-attachments bind index l display-message bind browser l select-entry bind pager,attach h exit bind index h quit bind index g first-entry bind index G last-entry bind browser g top-page bind browser G bottom-page bind pager g top bind pager G bottom # N hotkey default functions change bind to E hotkey, because I want to bind N as search-opposite bind index E toggle-new bind pager E mark-as-new bind browser E select-new bind index,pager,browser N search-opposite