E-mail configurations

Summary

The MTA (mail transport agent) is needed to send mail from the box -- you don't need anything to receive mail, unless the box acts as a mail server (which is a security risk).  Exim or procmail are commonly used and should work out of the box.

GnuPG is a free version of PGP for mail encryption and secure communication. It's set up for Thunderbird on clitunno.

Installation history

Linking local thunderbird folders to alpine
31 March 2007

It turns out alpine accepts a folder that is simply symlinked from thunderbird's local folders, like this:
steen@clitunno:~/mail$ ln -sf /share/data/ImapMail/LocalFolders/Teaching.sbd/2007.sbd/128 128
Not sure mailing out of pine is really working, however.

Local folders
10 December 2004

I've set the local folders for Thunderbird to sigillo:/spare/ImapMail and clitunno:/share/data/ImapMail -- normally, I expect to be using clitunno for e-mail, but if you plan to travel do a sync from clitunno to sigillo.

GnuPG
5 December 2004 on clitunno

I had to build mozilla-thunderbird-enigmail from the debian source package, as it needed to be compiled for gcc-3.4 and g++-3.4. See /share/software/src/zinfo for details.

I then followed the instructions at Using the GNU Privacy Guard to generate a privacy key.  This probably works, but it didn't seem to play nice with Mozilla and I deleted ~/.gnupg to start over.

Next, I switched to Encrypting your e-mails with Thunderbird, Enigmail & GnuPG and generated keys directly from Thunderbird. This works -- just make sure you don't use "Use pgp-agent for passphrase handling" -- that failed consistently (warrants further testing; there were a lot of variables and I may be mistaken).

To see your keys, issue "gpg --list-keys".

I then exported the keys to a public key server using this command (later I discovered kpgp will do it):
gpg --keyserver wwwkeys.pgp.net --send-keys 0x<public key ID>
It took a while, but eventually it worked. I sent for liontooth and my work address.

Exim (I put a copy of this section in Sigillo/exim.html)
18 January 2004 on sigillo

From /var/log/syslog:

Jan 19 18:23:01 sigillo /USR/SBIN/CRON[3699]: (mail) CMD (  if [ -x /usr/lib/exim/exim3 -a -f /etc/exim/exim.conf ]; then /usr/lib/exim/exim3 -q ; fi)
Jan 19 18:38:01 sigillo /USR/SBIN/CRON[3704]: (mail) CMD (  if [ -x /usr/lib/exim/exim3 -a -f /etc/exim/exim.conf ]; then /usr/lib/exim/exim3 -q ; fi)
Jan 19 18:53:01 sigillo /USR/SBIN/CRON[3709]: (mail) CMD (  if [ -x /usr/lib/exim/exim3 -a -f /etc/exim/exim.conf ]; then /usr/lib/exim/exim3 -q ; fi)
Jan 19 19:08:01 sigillo /USR/SBIN/CRON[3714]: (mail) CMD (  if [ -x /usr/lib/exim/exim3 -a -f /etc/exim/exim.conf ]; then /usr/lib/exim/exim3 -q ; fi)

So every 15 minutes this mail command runs. I don't see where the command is given -- kcron or crontab -e doesn't show it. There is a /etc/init.d/exim file -- but exim may also be running from /etc/inetd.conf. In fact I have this line there:

#:MAIL: Mail, news and uucp services.
smtp            stream  tcp     nowait  mail    /usr/sbin/exim exim -bs

When I issue "just list-files exim" I get (among other things) this:

/etc/init.d/exim
/etc/cron.daily/exim
/etc/cron.d/exim

So that's where it's started. The /etc/cron.daily/exim "cycles logs" -- dumps the old log to /dev/null. The /etc/cron.d/exim has the rest:

# /etc/cron.d/exim: crontab fragment for exim

# Run queue every 15 minutes
08,23,38,53 *     * * *     mail   if [ -x /usr/lib/exim/exim3 -a -f /etc/exim/exim.conf ]; then /usr/lib/exim/exim3 -q ; fi

# Tidy databases
13 6 * * *      mail    if [ -x /usr/sbin/exim_tidydb ]; then /usr/sbin/exim_tidydb /var/spool/exim retry >/dev/null; fi
17 6 * * *      mail    if [ -x /usr/sbin/exim_tidydb ]; then /usr/sbin/exim_tidydb /var/spool/exim wait-remote_smtp >/dev/null; fi
So that's where it is -- in /etc/cron.d. It's the only file there. I guess it would be tidier to do it in crontab, and less frequently.

Procmail

See the working promail on weber for an example, or this article.

On 7 August 2002 I complained to DigitalSpace.net's Wonderdesk that I was getting spoofed. He said they can't do anything, but that I could use procmail filtering.

There's a full list of procmail filtering scripts at
http://www.ling.helsinki.fi/users/reriksso/procmail/links.html#antispam

Here's a thorough one: http://www.spambouncer.org/

And one more: http://junkfilter.zer0.org/

I found instructions at http://www.css.tayloru.edu/~bbell/spam-filter/ for a simple setup (I hoped) and verified with a "locate procmail" that I had it, in /usr/bin/procmail.

Modeled on his, I created this .forward file:
"|IFS=' ' && exec /usr/bin/procmail -f- || exit 75 #cogweb"

I got trouble -- this blocks all mail. I tried removing the -f- but it made no difference.

I found better instructions here:
http://www.uwasa.fi/~ts/info/spamfoil.html

I did a supersimple setup on /home/cogweb, but it just blocks all incoming
mail. I asked support for help.

I have several mail accounts with the frog people. My root directory:

/home/cogweb

First priority is steen: cd /home/mail/steen. However, I don't have write access in this directory. I'll try installing things on /home/cogweb and see if that catches the mail to steen (unlikely).

Then I issued this elegant little command:

wget http://www.css.tayloru.edu/~bbell/spam-filter/.procmailrc

and the file was in place! So I have quite a bit of power on this machine.

I then created the .procmail directory under /home/cogweb. I tested that $HOME was what it should be with a echo $HOME and got /home/cogweb.

I then downloaded rc.maillists, which lists acceptable From: before the filter kicks in. Again I did it by wget http://www.css.tayloru.edu/~bbell/spam-filter/rc.maillists and then mv rc.maillists .procmail

Here's rc.maillists, unmodified:

# For this mailing list, just treat it as a normal file

:0
* From.*HumourNet
$DEFAULT

# This mailing list is HTML based, and I normally us a text-based
# mail reader, so forward all mail to another account I have
:0
* From.*infobeat.com
!other-acct@some-isp.com

# All mail from this list goes into the specified folder. This should
work
# with pine, elm, and other Un*x mail readers, but will not work when
# checking mail from Windows (using a POP3 client).
:0
* From.*javasoft.com
INBOX.java

"For more information on procmail recipes, see examples under the procmailrc and procmailex man pages."

Next, the spam filter. See the full explanation here:
http://www.css.tayloru.edu/~bbell/spam-filter/rc.spam.html

I got it with wget http://www.css.tayloru.edu/~bbell/spam-filter/rc.spam
and moved it to .procmail.

He assumes the following, now dubious:

To verify that the message is spam, I check to see if the message is not addressed to me. Rarely does a spam message actually list the real e-mail address in the "To" or "CC" field. Here I check to see if the message is (not) addressed to "bell". The reason is that I have a number of e-mail address that forward to this one account, but all have the word "bell" (my last name) in them. Replace "bell" with part or all of your e-mail address.

Here's the rc.spam, unmodified:

# First, catch any spam correction messages
:0
* ^Subject.*spam error
$DEFAULT

# Second, stop bounced messages
:0
* ^From: Mail Delivery Subsystem
{
:0 B
* X-Mailer: Bob's Spam Canceller
/dev/null
}

# Finally, nail those spammers!
:0
* !((^TO_.*taylor)|(^TO_.*bell))

| ~bbell/local/bin/formail -rf -I "X-Mailer: Bob's Spam Canceller" -I
"From: Bob Bell" -i "Subject: Your message has been deleted" | cat -
~bbell/.spam-msg | sendmail -t

I made these modifications:


 

 

top
Debate
Evolution
CogSci

Maintained by Francis F. Steen, Communication Studies, University of California Los Angeles


CogWeb