The Zen Of E-Mail Sorting


PMDIR=$HOME/Procmail
LOGFILE=$PMDIR/procmail.log
MAILDIR=$HOME/mail
DEFAULT=$MAILDIR/Unsorted
LOCKFILE=$PMDIR/.lockmail
VERBOSE=no

# Log MS-Specific Message-IDs (before flagging as dupes)
:0
* ^X-msmail
* ^\/Message-ID:.*$
{
  LOG="$MATCH"
}

# Duplicate removal
:0 Wh: $PMDIR/.duplicate.lock
* ? formail -D 256000 $PMDIR/.duplicate.procmail-cache
"Duplicates"

# SpamAssassin
#
# Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'
# if you use the spamc/spamd combination)
#
#* < 256000
#
# The condition line ensures that only messages smaller than 250 kB
# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
#
# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.
:0fw: $PMDIR/.spamassassin.lock
| spamc

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

"Spam/Definite"

# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
"Spam/Probable"

# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped.  This will re-add it.
:0
* ^^rom[ ]
{
  LOG="*** Dropped F off From_ header! Fixing up. "
  :0 fhw
  | sed -e '1s/^/F/'
}

And that's only the start of it. Going through around 70 mailboxes with:

formail -s procmail < input.mbox

...takes some doing.

Meanwhile, I have found the canonical way to convert .PST files: Dropping messages into an Exchange server and dragging them out again with Mozilla. fetchmail seems to choke after a bit, and I've yet to find out exactly why.

Samsung Palm Phone

Just came across this one. It's the SGH-i500, and apparently runs Palm OS 5. Looks nice. I wish they'd make up their mind, though. Clicking through PDA France I also came across their Series 60 device...

...and their Pocket PC Phone Edition device:

Covering all the bases, it seems. Oh well.