Setting up Email for OSS development work


This page is to capture the setup and configuration of functioning email that makes it easy to track multiple OSS mailing lists.

This is based on the excellent pages by andrew.46 on the Ubnutu forums, or for a newer page describing the use of msmtp over ssmpt see his own page: http://www.andrews-corner.org/mutt.html

Basically the only thing this page adds is a set of config files that "worked for me" in July 2008 on Ubuntu 8.04.1, and perhaps a bit of commentary.  The gmail account they use is real and "live" for now.

When setting up your email don't for get to hit the gmail settings page and tell it to delete pop accessed emails uppon pop access.  Otherise you'll get copies of the old emails after each fetchmail.

To fetch the mail from within the mutt, when you are in and index or pager mode of mutt, hit "I", to pull down the "Incomming" email. See the " macro index,pager I '<shell-escape> fetchmail -v<enter>' " in the .muttrc file below.

Don't forget to:
chmod 600 .fetchmailrc
chmod 600 .msmtprc
mkdir ~/.mutt
touch ~/.mutt/aliases

working .msmtprc

account default
host smtp.gmail.com
port 587
from dec0cb5a@gmail.com
tls on
tls_starttls on
tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt
auth on
user dec0cb5a
password oscon(123)
logfile ~/.msmtp.log

working .fetchmailrc

poll pop.gmail.com                   # Tell fetchmail about server
protocol POP3 # Use the POP-protocol
user 'dec0cb5a' # Your Gmail Username
password 'oscon(123)' # Your Gmail Password
mda "/usr/bin/procmail -d %T" # Tell fetchmail which MDA to use
options # Options duh
no keep # nuke the mail off the server
ssl # Use ssl
sslcertck # Check the certificates
sslcertpath /etc/ssl/certs # Path to the certificates

working .muttrc for use with msmtp (the first part is the important part...)

#======================================================#
# Boring details
set realname = "mark gross"
set from = "dec0cb5a@gmail.com"
set use_from = "yes"
set envelope_from ="yes"

set alias_file=~/.mutt/aliases
source ~/.mutt/aliases

set sendmail= /usr/bin/msmtp

alias markgross markgross@thegnar.org
alias dec0cb5a mgross <dec0cb5a@gmail.com>

macro index,pager I '<shell-escape> fetchmail -v<enter>'

# If not set in environment variables:
# set spoolfile = /var/spool/mail/your_user_id_here

#======================================================#
# Folders
set folder="~/Mail" # my _local_ mail folder
set record="+sent" # where to store sent messages
set mbox="+mbox" # local mail storage
set postponed="+postponed" # where to store draft messages
set move=ask-yes # Move to mbox: default yes.

#======================================================#
# Watch these mailboxes for new mail:
mailboxes ! +Fetchmail +slrn +mutt
set sort_browser=alpha # Sort mailboxes by alpha(bet)

#======================================================#
# Order of headers and what to show
hdr_order Date: From: User-Agent: X-Mailer \
To: Cc: Reply-To: Subject:
ignore *
unignore Date: From: User-Agent: X-Mailer \
To: Cc: Reply-To: Subject:

#======================================================#
# which editor do you want to use?
# vim of course!
set editor="vim -c 'set tw=70 et' '+/^$' "
# set edit_headers # See the headers when editing

#======================================================#
# Aliases

set sort_alias=alias # sort aliases in alpha order by alias name
alias sample Mr AD Sample <emailaddress>

#======================================================#
# Colours: This scheme is fairly basic and only
# really works if your Terminal background is white

color hdrdefault black default
color quoted red default
color signature brightblack default
color indicator brightwhite red
color attachment black green
color error red default
color message blue default
color search brightwhite magenta
color status brightyellow blue
color tree red default
color normal blue default
color tilde green default
color bold brightyellow default
color markers red default

#======================================================#
# Odds and ends
set markers # mark wrapped lines of text in the pager with a +
set smart_wrap # Don't wrap mid-word
set pager_context=5 # Retain 5 lines of previous page when scrolling.
set status_on_top # Status bar on top.
push <show-version> # Shows mutt version at startup

Working .procomailrc

# Environment variable assignments
PATH=/bin:/usr/bin:/usr/local/bin
VERBOSE=off # Turn on for verbose log
MAILDIR=$HOME/Mail # Where Procmail recipes deliver
LOGFILE=$HOME/.procmaillog # Keep a log for troubleshooting.

DEFAULT=$MAILDIR/mbox

# Create a backup cache of 200 most recent messages in case of
# mistakes (yes, you can change the 200 to 20 or 400 or whatever
# you want)
:0 c
backup

:0 ic
| cd backup && rm -f dummy `ls -t msg.* | sed -e 1,200d`

# Regenerate "From" lines to make sure they are valid
:0 fhw
| formail -I "From " -a "From "


# Recipes
:0:
* ^TOdec0cb5a
IN.oscon2008


###########
# linux-kernel #
###########

:0:
* ^X-Mailing-List:.*linux-rt-users.vger.kernel.org
IN.linux-rt-users

:0:
* ^X-Mailing-List:.*linux-kernel.vger.kernel.org
IN.lkml

:0:
* ^X-Mailing-List:.*linux-usb.vger.kernel.org
IN.linux-usb

:0:
* ^From: *lists.openembedded
IN.oe

:0:
* ^X-BeenThere: linux-pm@lists.osdl.org
IN.linux-pm


#####################################
# Last rule: Put mail into mailbox #
#####################################
:0:
$DEFAULT