Infrablue atTripod

 
Home
Cygwin Part 1
Cygwin Part 2
Cygwin Part 3
Int'l. Keyboard



Useful Configuration of Cygwin, Part 3: Mail



Setting up Exim

Cygwin now comes with the popular Exim mail transport agent.  The Exim package comes with a very simple setup script which can be run from the console:

 
exim-config 

This is enough to set Exim up and install and run the service.  It will work fine for delivering mail to local users on the system .  Iam still trying to figure you how to get it to do SMTP authorization with a smarthost.  Most people will need this since they have an account with an ISP whose mail server they authorize with and send outgoing mail through.  Its a shame that there are no examples nor documentation with the Exim Cygwin package on how to do this.


Setting up Mutt

Mutt is probably the most widely-used console-based e-mail application.  It is highly configurable and powerful.  Here is a skeletal
~/.muttrc that you can use to get started (note: this skeletal .muttrc will also work fine on Linux systems):

set folder=/var/spool/mail
set spoolfile=/var/spool/mail/$USER
set record=+sent
set editor="vim -c 'set textwidth=72'"
# Sort mailboxes according to date received in reverse order (newest messages)
# at the top
set sort=reverse-date
set arrow_cursor=no
set move=no
set markers=no
set askbcc=yes
set menu_scroll=yes
set pager_stop
bind pager <up> previous-line
bind pager <down> next-line
set resolve=no
mailboxes ! +mutt-users +exim-users
folder-hook mutt-users 'set sort=threads'
folder-hook mutt-users 'set sort_aux=reverse-date-received'
folder-hook exim-users 'set sort=threads'
folder-hook exim-users 'set sort_aux=reverse-date-received'
alias mutt-users Mutt User List <mutt-users@mutt.org>
lists mutt-users exim-users
color normal default black
color hdrdefault red default
color quoted brightblue default
color signature red default
color indicator white blue
color error brightred default
color status yellow blue
color tree magenta default # the thread tree in the index menu
color tilde magenta default
color message brightcyan default
color markers brightcyan default
color attachment brightmagenta default
color search default green # how to hilite search patterns in the pager
color header brightred default ^(From|Subject):
color body magenta default "(ftp|http)://[^ ]+" # point out URLs
color body magenta default [-a-z_0-9.]+@[-a-z_0-9.]+ # e-mail addresses
color underline brightgreen default


Setting up procmail

Procmail is a powerful tool used to filter incoming e-mail.  You set up
rules in your ~/.procmailrc which filter incoming mail accordingly.  Here is a basic sample ~/.procmailrc:

#PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:
MAILDIR=$HOME/mail
DEFAULT=$MAILDIR/inbox
LOGFILE=$MAILDIR/procmail.log
LOCKFILE=$HOME/.lockmail
VERBOSE=yes


:0:
* ^(Cc|To).*cygwin*@cygwin.com
cygwin


This simple filter will process incoming mail that is To: or Cc: to the cygwin mailing list into the cygwin folder.  All other mail will by default go to ~/mail/inbox.  Note that if you use this setup you will want to change the following lines in your
~/.muttrc:

set folder=/var/spool/mail
set spoolfile=/var/spool/mail/$USER


to this:

set folder=~/mail
set spoolfile=~/mail/inbox



Setting up fetchmail

Fetchmail is used to poll mail servers and retrieve mail.  The configuration file is
~/.fetchmailrc.  Here is a simple example:

defaults
mda "/usr/bin/procmail -f %F -d %T"
set no bouncemail
poll 'pop.isp.com'
protocol pop3
username 'username@isp.com'
password 'mypass'
is localuser here


Replace 'localuser' with your local user account and the other logon credentials accordingly.





References:


"Mutt on Cygwin"; http://www.geocities.com/win32mutt/cygwin.html
"How to install a SMTP server (called cygwin-exim) on a Windows 2000/XP box"; http://pigtail.net/LRP/cygwin-exim.html
"41.1. Sending mail to a smart host"; http://www.exim.org/exim-html-4.20/doc/html/spec_41.html#IX2284
"3. ROUTING TO REMOTE HOSTS"; http://www.exim.org/exim-html-4.20/doc/html/FAQ_3.html#TOC115
"Mutt on Cygwin, Setup sSMTP"; http://www.geocities.com/win32mutt/cygwin-ssmtp.html


  Home Cygwin Part 1 Cygwin Part 2 Cygwin Part 3 Int'l. Keyboard