# # ££ file : muttrc # __,ôô by : rhatto at riseup.net # \\,_O # /~ # # ----------- # Color setup # ----------- #source "~/.mutt/colors/default" source "~/.mutt/colors/solarized/mutt-colors-solarized-dark-256.muttrc" # -------------------- # General mutt options # -------------------- # reset all set tmpdir = "~/temp/mutt/misc" set reply_to = ask-yes set reverse_name = yes set reverse_realname = yes set gecos_mask = "^[^,]*" set hidden_host = no set hostname = "localhost" set beep = no set user_agent = no set quit = yes set read_inc = 10 set mail_check = 120 set mail_check_recent = no set mark_old = no set menu_scroll = no set help = yes set delete = yes set charset = "utf-8" # ---------------------- # OS Specifiques options # ---------------------- set ispell="aspell -e -c --lang=pt_BR" set spoolfile = "~/mail/INBOX" # -------- # Printing # -------- # Disable printing entirely #bind index p noop #bind pager p noop #bind pager P noop # Always ask for confirmation set print = ask-no # Muttprint # See https://unix.stackexchange.com/questions/20456/pretty-print-mails-from-mutt # https://unix.stackexchange.com/questions/283943/printing-email-messages-from-mutt-how-to-avoid-line-break # https://muttprint.sourceforge.net/ # # Display the PDF after printing it #set print_command='set -e; mkdir -p "$HOME"/.cache/mutt; f=`mktemp -p "$HOME"/.cache/mutt`; \ # muttprint -P A4 -p TO_FILE:"$f"; zathura "$f"; rm "$f"' # # Simply produce the PDF # Needs additional tuning on the mutt firejail profile in order to work #set print_command='set -e; mkdir -p "$HOME"/.cache/mutt; f=`mktemp -p "$HOME"/.cache/mutt muttprint.XXXX.ps`; \ # muttprint -P A4 -p TO_FILE:"$f"; ps2pdf "$f"; echo Saved output into `basename "$f" .ps`.pdf' # Simply output the message to a file set print_command='set -e; mkdir -p "$HOME"/.cache/mutt; f=`mktemp -p "$HOME"/.cache/mutt muttprint.XXXX.txt`; \ cat - > "$f"; echo Saved output into "$f" \ echo You convert it to a PDF using the following command: ; \ echo "" ; \ echo "cat $f | muttprint -P A4 -p TO_FILE:$f.ps ; ps2pdf $f.ps"' # ---------- # Menu index # ---------- set thorough_search=yes set status_format = "-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? Novas:%n?%?o? Velhas:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---" set strict_threads = yes set sort = threads set sort_aux = date-received # -------------- # Internal Pager # -------------- set visual = "" set sig_dashes = yes set smart_wrap = yes set smileys = "(>From )|(:[-^]?[][)(><}{|/DP])" set quote_regexp = "^([ \t]*[|>:}#])+" set pager = "builtin" set pager_context = 0 set pager_format = "-%Z- %C/%m: %-20.20n %s" set pager_index_lines = 0 set pager_stop = no set pager_index_lines=8 set markers = no set escape = "~" set tilde = no # --------- # Composing # --------- set editor = "vim" set postponed = "~/temp/mutt/postponed" set abort_unmodified = no macro compose q " " "Postpone message" macro compose x " n" "Discard message" # -------- # Replying # -------- #set attribution = "Em %d, %n escreveu:" # ---------- # Forwarding # ---------- set forward_format = "Fwd: %s" # ------------------ # Folder and Mailbox # ------------------ set folder = "~/mail" set record = "mail/INBOX.Sent" set move = no set folder_format = "%2C %t %N %f" # Save sent messages in the current folder, so threads get your own replies # See http://dev.mutt.org/trac/wiki/MuttFaq/Folder # http://www.davep.org/mutt/muttrc/folder-hooks.html # http://www.earth.li/~huggie/mutt/muttrc.html # http://rc.vc/files/mutt/folderhooks.html #folder-hook =INBOX$ 'set record = "mail/INBOX.Sent"' folder-hook . 'set record="^"' # ------- # Sending # ------- set use_from = yes set save_address = yes set envelope_from = yes # ----- # Alias # ----- set alias_file = "~/.custom/mutt/aliases" source "~/.custom/mutt/aliases" # ---------------------------------------- # Attached documents # # http://wiki.mutt.org/?MuttFaq/Attachment # ---------------------------------------- set attach_format = "%u%D%I %t%4n %T%.40d%> [%.7m/%.10M, %.6e%?C?, %C?, %s] " set attach_sep = "\n" set attach_split = yes macro attach W ~/load/ macro attach E ~/load/ # ---- # MIME # ---- set rfc2047_parameters = no set mime_forward_rest = yes set message_format = "%s" set mailcap_path = ".mailcap" set mailcap_sanitize = yes set mime_forward = no set mime_forward_decode = no set implicit_autoview = no # -------- # Sendmail # -------- set use_8bitmime = no set sendmail = "/usr/bin/msmtp" # ---------------------------------------------- # OpenPGP basic options # # http://dev.mutt.org/trac/wiki/MuttGuide/UseGPG # ---------------------------------------------- macro index S ":toggle pgp_verify_sig\n" # define S to toggle sig check macro index A ":toggle pgp_autosign\n" # define A to toggle autosign set crypt_replysignencrypted = yes set crypt_replyencrypt = yes set crypt_autosign = no set crypt_replysign = no set pgp_verify_sig = yes set pgp_replyencrypt = yes set pgp_decode_command="gpg --no-verbose --quiet --batch --output - %f" set pgp_verify_command="gpg --no-verbose --batch --output - --verify %s %f" set pgp_import_command="gpg --no-verbose --import -v %f" set pgp_export_command="gpg --no-verbose --export --armor %r" set pgp_verify_key_command="gpg --no-verbose --batch --fingerprint --check-sigs %r" set pgp_list_pubring_command="gpg --no-verbose --batch --with-colons --list-keys %r" set pgp_list_secring_command="gpg --no-verbose --batch --with-colons --list-secret-keys %r" set pgp_good_sign="^gpg: Assinatura correta de" # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=172960 #set pgp_getkeys_command="gpg --recv-keys %r" set pgp_getkeys_command="gpg --search-keys %r" # See https://a3nm.net/blog/mutt_crypt_opportunistic_encrypt.html set crypt_opportunistic_encrypt = yes # ----------------------------- # OpenPGP with gpg-agent config # ----------------------------- set pgp_use_gpg_agent = yes set pgp_decrypt_command="gpg --no-verbose --batch --output - %f" set pgp_sign_command="gpg --no-verbose --batch --output - --armor --detach-sign --textmode %?a?-u %a? %f" set pgp_clearsign_command="gpg --no-verbose --batch --output - --armor --textmode --clearsign %?a?-u %a? %f"set pgp_encrypt_only_command="/usr/lib/mutt/pgpewrap gpg -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" # -------------------------------- # OpenPGP without gpg-agent config # -------------------------------- #set pgp_decode_command="gpg %?p?--passphrase-fd 0? --no-verbose --batch --output - %f" #set pgp_decrypt_command="gpg --passphrase-fd 0 --no-verbose --batch --output - %f" #set pgp_sign_command="gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --digest-algo sha256 --detach-sign --textmode %?a?-u %a? %f" #set pgp_clearsign_command="gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --digest-algo sha256 --textmode --clearsign %?a?-u %a? %f"set pgp_encrypt_only_command="/usr/lib/mutt/pgpewrap gpg -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" #set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg --passphrase-fd 0 -v --batch --output - --digest-algo sha256 --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" # ------ # S/MIME # ------ # # Seems like S/MIME support on mutt is currently broken, and mutt may timeout # when "Invoking S/MIME". # # See https://lists.gnupg.org/pipermail/gnupg-users/2023-August/066655.html # https://gitlab.com/muttmua/mutt/-/wikis/MuttGuide/UseSMIME # https://en.wikipedia.org/wiki/S/MIME # https://gitlab.com/muttmua/mutt/-/wikis/MuttGuide/UseSMIME # http://web.archive.org/web/20150919063418/https://kb.wisc.edu/middleware/page.php?id=4091 # http://equiraptor.com/smime_mutt_how-to.html # https://superuser.com/questions/614985/in-mutt-how-to-extract-key-from-a-s-mime-signed-message-to-reply-encrypted # https://man.archlinux.org/man/extra/mutt/smime_keys.1.en # https://mutt-users.mutt.narkive.com/MyCrGRy1/s-mime-verification # https://github.com/neomutt/neomutt/issues/3438 # https://github.com/neomutt/neomutt/issues/3567 # # Unsetting this might break OpenPGP handling entirely. #unset crypt_use_gpgme # # CA location #set smime_ca_location = /etc/ssl/certs/ca-certificates.crt # --------- # Mailboxes # --------- #mailboxes $HOME/mail/inbox `echo $HOME/mail/* | sed -e "s|$HOME/mail/inbox||g"` mailboxes `echo $HOME/mail/*` # -------------- # Mail reception # -------------- #macro pager z "unset wait_key\n!clear ; fetchmail || [ $? -eq 1 ]\n=INBOX/\n" "Fetch new mail" #macro index z "unset wait_key\n!clear ; fetchmail || [ $? -eq 1 ]\n=INBOX/\n" "Fetch new mail" #macro pager z "unset wait_key\n!clear ; getmail || [ $? -eq 1 ]\n=INBOX/\n" "Fetch new mail" #macro index z "unset wait_key\n!clear ; getmail || [ $? -eq 1 ]\n=INBOX/\n" "Fetch new mail" #macro pager z "unset wait_key\n!clear ; getmails || [ $? -eq 1 ]\n=INBOX/\n" "Fetch new mail" #macro index z "unset wait_key\n!clear ; getmails || [ $? -eq 1 ]\n=INBOX/\n" "Fetch new mail" macro pager z "unset wait_key\n!clear ; getmails-alternative || [ $? -eq 1 ]\n=INBOX/\n" "Fetch new mail" macro index z "unset wait_key\n!clear ; getmails-alternative || [ $? -eq 1 ]\n=INBOX/\n" "Fetch new mail" # ---------------------------------------- # Navigation # # http://blog.jwcxz.com/?p=810 # http://rc.vc/files/mutt/keybindings.html # ---------------------------------------- bind index P collapse-all macro index n "" macro pager n "" macro index i "" macro pager i "" macro index F "" macro pager F "" macro index,pager M "T \n;WN^t \n" "Mark all messages read" macro index,pager c "?~/mail" "Change folder" macro index,pager y "?1\n\n" "Back to INBOX" macro index,pager \' "~F" "Jump to next important message" # ------------- # Ignore fields # ------------- ignore X ignore Delivered-To ignore Precedence ignore List ignore Errors-To ignore In-Reply-To ignore Importance ignore Mail-Followup-To ignore Organization ignore Thread ignore ReSent ignore Disposition ignore Return ignore RT ignore Priority ignore DomainKey-Signature ignore Message ignore MIME ignore Received ignore References ignore Content ignore DKIM-Signature ignore X-Mailer ignore User-Agent unignore List-Archive # --------- # Auto view # --------- auto_view text/html auto_view application/msword auto_view text/richtext auto_view image/* macro pager \cb 'urlview' 'Follow links with urlview' # ------ # Mairix # ------ #macro index \es "mairix " "Run a Mairix search" #macro index \em "=INBOX.Search/\n" "Switch to Mairix virtual folder" # ---------------------------------------------------------------------------------------- # Notmuch # For info look at http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt # https://wiki.archlinux.org/index.php/Notmuch # ---------------------------------------------------------------------------------------- #macro browser "unset wait_keymutt-notmuch --prompt search\ # ../.cache/mutt_results" "search mail (using notmuch)" # macro index,pager "~/apps/utils-mail/mutt-notmuch-tag" "Tag messages (using notmuch)" macro index,pager \ "set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ notmuch-mutt -r --prompt search\ `echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`\ set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ "notmuch: search mail" macro index,pager \ "set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ notmuch-mutt -r thread\ `echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`\ set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ "notmuch: reconstruct thread" macro index,pager \ "set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ notmuch-mutt tag -- -inbox\ set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ "notmuch: remove message from inbox" # ---------- # Bogofilter # # https://www.bogofilter.org/ # https://bogofilter.bogofilter.narkive.com/dLzJfNrg/training-with-maildir-mutt # https://github.com/tjouan/bogorb/blob/master/bin/bogolearn # https://exstrom.com/journal/comp/bogofilter.html # ---------- macro index s "unset wait_key\nbogofilter -MSn\nset wait_key\n?" macro pager s "unset wait_key\nbogofilter -MSn\nset wait_key\n?" macro index r "unset wait_key\nbogofilter -Mn\nset wait_key\n" macro pager r "unset wait_key\nbogofilter -Mn\nset wait_key\n" macro index g "unset wait_key\nbogofilter -Mn\nset wait_key\n" macro pager g "unset wait_key\nbogofilter -Mn\nset wait_key\n" macro index l "unset wait_key\nbogofilter -Mn\nset wait_key\n" macro pager l "unset wait_key\nbogofilter -Mn\nset wait_key\n" macro index X "unset wait_key\nbogofilter -MNs\nset wait_key\n" macro pager X "unset wait_key\nbogofilter -MNs\nset wait_key\n" macro index H "unset wait_key\nbogofilter -n\n" "Learn as ham and save" macro pager H "unset wait_key\nbogofilter -n\n" "Learn as ham and save" # ---------------------------------------------------------------- # Schleuder config # # http://schleuder2.nadir.org/contrib/schleuder-with-mutt.html # ---------------------------------------------------------------- #color body red default "^From: .*" #color body red default "^To: .*" #color body red default "^Cc: .*" #color body red default "^Date: .*" #color body brightred default "^Enc: unenc.*" #color body red default "^Enc: enc.*" #color body brightred default "^Sig: [^G]?.*" #color body red default "^Sig: Good signature.*" #color body red default "^Resent-to: .*" #color body brightred default "^Note: .*" # ----------------------------------- # Schleuder config, solarized version # ----------------------------------- color body red color234 "^From: .*" color body red color234 "^To: .*" color body red color234 "^Cc: .*" color body red color234 "^Date: .*" color body brightred color234 "^Enc: unenc.*" color body red color234 "^Enc: enc.*" color body brightred color234 "^Sig: [^G]?.*" color body red color234 "^Sig: Good signature.*" color body red color234 "^Resent-to: .*" color body brightred color234 "^Note: .*" # ------------------------------------------------------------------------------------------------------------------ # Multiple accounts # # You cycle through accounts in the message composition menu by hitting the Tab key. # # http://msmtp.sourceforge.net/doc/msmtp.html # https://www.verboom.net/blog/index.html?single=20110518.0 # http://hep.itp.tuwien.ac.at/cgi-bin/dwww/usr/share/doc/muttprofile/muttprofile.html # http://dev.mutt.org/trac/wiki/ConfigTricks#Generatingsend-hooksfromaddressesinaflattextfile # http://www.techrepublic.com/blog/linux-and-open-source/my-number-one-reason-to-use-mutt-managing-multiple-profiles # ------------------------------------------------------------------------------------------------------------------ macro compose "\Cx1" macro compose \Cx& ":macro compose \\t \\Cx" # ----------------------------------- # Sidebar: needs mutt-patched package # ----------------------------------- #source "~/.mutt/sidebar" set sidebar_visible=no # ----------------------------------------------------- # Protected Headers, aka Memory Hole # # http://www.mutt.org/relnotes/1.12/ # https://github.com/autocrypt/protected-headers # https://datatracker.ietf.org/doc/draft-autocrypt-lamps-protected-headers/ # https://www.ietf.org/archive/id/draft-autocrypt-lamps-protected-headers-02.txt # ----------------------------------------------------- set crypt_protected_headers_read = yes set crypt_protected_headers_write = yes set crypt_protected_headers_save = yes set crypt_protected_headers_subject = "Encrypted subject" # ------------------------------------------------------------------------ # Autocrypt # # https://autocrypt.org/ # https://en.wikipedia.org/wiki/Autocrypt # http://www.mutt.org/relnotes/1.13/ # http://www.mutt.org/doc/manual/#autocryptdoc # https://muacrypt.readthedocs.io/mutt.html (alternative implementation) # https://neomutt.org/guide/autocryptdoc.html (alternative, using neomutt) # ------------------------------------------------------------------------ #set autocrypt = yes #set autocrypt_dir = "~/.local/share/mutt/autocrypt" # ----------------------------------------------------- # Custom configuration # # We keep this section after all other stuff so custom # configuration can overwrite all defaults. # ----------------------------------------------------- source "~/.custom/muttrc"