### ~/.mutt/muttrc ### A well configured muttrc for secure use of gmail ## Verify mail server names, port numbers, etc if using with Yahoo or other similar webmail services that provide IMAP access ## Place the sorta script in ~/.mutt/ for alias sort macro to work. ##It's bound to 0 for use in muttmenu screens.## A brief how-to can be found on the Vinux Wiki ## along with a recent copy of my sample muttrc file. ## Files to use source ~/.mutt/aliases ##To use gpg encrypted pw set my_tmp=`gpg -o ~/.mutt/.tmp -d ~/.mutt/.pass.gpg` ## decrypted password # set my_gpass=`awk '/gmail:/ {print $2}' ~/.mutt/.tmp` # ## setting passwords set imap_pass = $my_gpass set smtp_pass = $my_gpass # ## Deleting .tmp file immidiately set my_del=`rm -f ~/.mutt/.tmp` ## Change the following lines to match your gmail account details ## For a bit more information and password encryption instructions go to the Mutt set-up article ## on the Vinux Wiki. http://wiki.vinuxproject.org/mutt_configuration_and_basic_use ## Uncomment and edit if YOU DO NOT WANT 2USE ENCRYPTED PASSWD. ## If you must use pop change imap to pop, change port numbers, etc. set imap_user = "username@gmail.com" #set imap_pass = "my_pw" set smtp_url = "smtp://username@smtp.gmail.com:587/" #set smtp_pass = "my_pw" set from = "username@gmail.com" set realname = "your name" ## Comment the next line or change to no to put sig below quoted message(s) set sig_on_top = yes set signature="~/.mutt/sig" # Change the following line if you prefer a different editor. set editor = "nano" ## Basic config, you can leave this as is in most cases # Not sure if timeout and keepalive value tweaking will help intermittent connection issues # (time values are in seconds) set wait_key = no set folder = "imaps://imap.gmail.com:993" set spoolfile = "+INBOX" set imap_check_subscribed set hostname = gmail.com set mail_check = 150 set beep_new set connect_timeout = 25 set timeout = 300 # Keep IMAP connection alive by polling intermittently set imap_keepalive = 180 # Allow Mutt to open new imap connection automatically unset imap_passive set postponed = "+[gmail]/Drafts" # set postpone=ask-yes set record = "+[gmail]/Sent Mail" set header_cache=~/.mutt/cache/headers set message_cachedir=~/.mutt/cache/bodies ## You may need to create your tmpdir in some situations. set tmpdir = ~/.mutt/tmpdir set certificate_file=~/.mutt/certificates set alias_file=~/.mutt/aliases set move = no set honor_followup_to = ask-yes ## Automatically includes quote of the original msg in replies # set include ## If you want to be asked whether to include quoted message(s) set include=ask-yes ## Asks whether to forward non plain text mime types attached as they came or to convert to inline plain text set mime_forward = ask-no set sort = 'threads' set sort_aux = 'reverse-last-date-received' ## The next two are set oposite of default if uncommented. *(needs more study) #set strict_threads = yes #set sort_re = no set auto_tag = yes ## Reminds you of missing subject&unmodified or empty body with msg sent as default set abort_nosubject = ask-no set abort_unmodified = ask-no ignore "Authentication-Results:" ignore "DomainKey-Signature:" ignore "DKIM-Signature:" hdr_order Date From To Cc Bcc # Change "my-gpg-key-id" below to your gpg key id. my_hdr X-PGP-Key: gpg --recv-keys my-gpg-key-id --keyserver hkp://pool.sks-keyservers.net set attribution = "\n %n wrote:\n%d\n" ## Character or string to appear at the start of quoted lines in replys set indent_string = "> " set forward_format = "[FWD: %a] %s" set mailcap_path = ~/.mutt/mailcap auto_view text/html #set implicit_autoview = yes ## Uncomment below to read plain text instead of html when both formats exist. #alternative_order text/plain text/html * set folder_format = "%2C %f %8s %t %F %-8.8u %N %d" ## Scrolls one line at a time, i.e. smoothly scrolls, instead of only moving up or down by whole pages, screen-fulls if you will set menu_scroll = yes ## Read and write progress messages update frequency: The value is a number of messages. set read_inc = 20 set write_inc = 10 ## Some useful extra key bindings ## Improve tab completion: complete address aliases with tab... bind attach view-mailcap bind editor complete # default Mutt setting bind editor ^T complete-query unset query_command # default Mutt setting bind editor noop ## Optimize copy and save to show mailbox list without prompting ## Use numbers to jump directly to a mailbox, i.e. skip arrowing macro index,pager C "?" "copy a message to a mailbox" macro index,pager s "?" "move a message to a mailbox" ##This configuration provides encryption via gpgme&gpg; auto-signing is default for all. ##Also stores encrypted mail as such, I.E. sent folder ## Uncomment the encrypt-to line in ~/.gnupg/gpg.conf and fill in your key-id. ## Don't forget to replace your-key-id with your key id below in the pgp_sign_as line! set pgp_use_gpg_agent = yes ## Use GPGME set crypt_use_gpgme = yes ## Sign all email by default set crypt_autosign = yes # Encrypt replies to encrypted email set crypt_replyencrypt = yes ## Attempt to verify email signatures automatically set crypt_verify_sig = yes ## In case keys can be validated via DNS set crypt_use_pka=yes set pgp_sign_as=your-key-id ## This remembers your email account pw for 5 hours which has its security implications. ## Control f, "^f" should forget passphrase(s) stored in memory. set pgp_timeout=18000 set pgp_good_sign="^gpg: Good sig from" ## Keybindings for custom macros that add useful functionality to Mutt ## View Documentation in browser so you can use hyperlinks to quickly get to what you need to know macro generic,index,pager "!lynx /usr/share/doc/mutt/manual.html\n" "Show Mutt documentation" ## Use sorta script to put aliases in alphabetical order macro generic,index,pager 0 "!~/.mutt/sorta\n" "Sort Aliases" ## Turn on fast reply macro generic,index,pager + " set fast_reply = yes\n" ## Turn off fast reply; show header fields to edit before entering message body macro generic,index,pager _ " set fast_reply = no\n" ##switch to GUI editor, coded to gedit for the moment macro generic,index,pager ge "set editor = \"gedit\"\n" "Use GUI Editor" ##switch back to CLI editor, currently hard-coded to nano macro generic,index,pager ^te "set editor = \"nano\"\n" "Use CLI Editor" ## Switch signature between above and below quoted message(s) macro generic,index,pager Aq " set sig_on_top = yes\n" macro generic,index,pager Bq " set sig_on_top = no\n" ## gmail-style keyboard shortcuts: Some are being revised, so they are commented for now. #macro index,pager y "unset trash\n " "gmail archive message" #macro index,pager d "set trash=\"imaps://imap.gmail.com:993/[gmail]/Trash\"\n " "gmail delete message" ##imaps://imap.gmail.com:993/[gmail]/Trash\"\n " "gmail delete message" ##imaps://imap.googlemail.com/[gmail]/Bin\"\n " "gmail delete message" macro index,pager gi "=INBOX" "Go to inbox" macro index,pager ga "=[gmail]/All Mail" "Go to all mail" macro index,pager gd "=[gmail]/Drafts" "Go to drafts" macro index,pager gs "=[gmail]/Starred" "Go to starred messages" #macro generic,index,pager g2 "=/home/user/muttmail/2read" "Go to 2read" ### Some useful alt configurations ## I've left some options that I sometimes switch to in place above commented out for easy changes. ## Uncomment any of the alt settings found below and paste in to the appropriate section. ## For desired results do not forget to comment or delete conflicting lines ## E.G. sign all will obviously override the following option ## Sign replies to signed messages # set crypt_replysign = yes # Encrypt and sign replies to encrypted and signed email # set crypt_replysignencrypted = yes ## Do not encrypt copies of messages in sent mail folder #set fcc_clear = no