As a preface, let me explain the following settings are for mutt 1.4.x; the default version of mutt included with Cygwin is 1.2.5i, and is rather dated, if not archaic. I know this configuration will not work with the default mutt client bundled.
The good news is that mutt 1.4.1i builds right ‘out of the box’ from the current code tree. Download the sources, untar, and configure. To be compatible with cygwin’s default directory heirarchy, and to have all of my necessary options, I built my own version of mutt as follows (I disable NLS, I speak english, and find it unnecessary for my own uses, but it won’t hurt to leave it on):
./configure —disable-nls—disable-flock—with-ssl—enable-pop—enable-imap—with-regex—prefix=/usrThen, after installing mutt, I setup my .muttrc as follows, as I don’t plan to keep a local spool often, and prefer to read via imap; this is not my primary MUA. This configuration does not have GPG support integrated, use APOP or any form of authentication, which is not my exact configuration, but should work for the mast majority of users, plus, it keeps this example rather brief:
#We’re using ssmtp, not sendmail; Configure with ssmtp-config prior to use! set sendmail = ”/usr/sbin/ssmtp.exe” #Local spool set folder = ”$HOME/Mail” #Just in case I forget to use an alias… set spoolfile = {mail.defaulthost.com} #Unset the defaults, if there were any set. account-hook . ‘unset imap_user; unset imap_pass; unset spoolfile’ #Account one, my default account-hook imap://mail.defaulthost.com ‘set imap_user =”myusername”; set imap_pass = “mypassword”; set realname = “My Name for this MX”; set from = “myusername@mydomain.tld”; set signature=~/.signature-defaulthost; set spoolfile = {mail.defaulthost.com}’ #My secondary account account-hook imap://mail.secondary.com ‘set imap_user =”mysecondaryusername”; set imap_pass = “mysecondarypass”; set realname = “My Name for the secondary MX”; set from = “mysecondaryusername@secondary.tld”; set signature=~/.signature-secondary; set spoolfile = {mail.secondary.com}’ #We don’t need APOP for this example. set imap_authenticators = login #No need for a reply-to set reply_to = no #I don’t want to be archived by lists my_hdr X-No-Archive: yes(You’ll want to chmod this .muttrc 600 to keep your passwords secure.)
Then, of course, I created the ~/.signature files.
This isn’t quite finished, though. I generally use the rxvt that is shipped with Cygwin as my default shell, and it has a few nasty problems with terminal types and colors. As a quick workaround, I setup the following aliases in my .zshrc:
alias muttprimary=’export OLDTERM=$TERM; export TERM=vt100; mutt -f imap://mail.defaulthost.com/; export TERM=$OLDTERM; unset OLDTERM’ alias muttsecondary=’export OLDTERM=$TERM; export TERM=vt100; mutt -f imap://mail.secondary.com/; export TERM=$OLDTERM; unset OLDTERM’You should now have a fully functional mutt ready for use with multiple email accounts! (To use pop3, just exchange the “imap_*” variables with “pop_”, and imap:// URIs to pop://.)