Page tree
Skip to end of metadata
Go to start of metadata

This document is horrible, don't use it. The examples directory included with SpamAssassin includes procmail. Just use that. If your .procmailrc isn't processed, fix your mail server software instead of resorting to running formail, deleting your inbox, then running mutt once.

UsingMutt BY Widgeteye


This is how I use Mutt and procmail. Whether it is the accepted way I don't know but it 'works' for me.

in the .forward file I have;

"|/usr/bin/procmail f | exit 75 #myusername"

#2) "|IFS=' ' && exec /usr/bin/procmail f | exit 75 #myusername"

For some reason the accepted line (#2) wouldn't work, I don't know if it's because I use exim as mta or what but the line above that did work.

I have an executable file that calls Mutt, in that file I have;


formail -s procmail < /var/spool/mail/myusername

rm /var/spool/mail/myusername

mutt -y

Check man mutt to figure out the -y option.

In the .muttrc you need the following lines;

set folder=$HOME/mail #Make sure this directory exists

mailboxes =almost-certainly-spam

mailboxes =from #optional

mailboxes =mbox

mailboxes =probably-spam

You'll notice these mailboxes match a couple of the mailboxes in the .procmailrc file. REMEMBER, every time you change a mailbox in the .procmail file you have to make the same change in the .muttrc file.

Here's what I have in the .procmailrc file;


MAILDIR=$HOME/mail # You'd better make sure it exists

DEFAULT=$MAILDIR/mbox #this is the default mailbox in the .muttrc file.



# The lock file ensures that only 1 spamassassin invocation happens

# at 1 time, to keep the load down.


:0fw: spamassassin.lock

  • < 256000


# 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.)


  • ^X-Spam-Level: \\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*

# /dev/null

almost-certainly-spam #this is the mailbox in the .muttrc file

# All mail tagged as spam (eg. with a score higher than the set threshold)

# is moved to "probably-spam".


  • ^X-Spam-Status: Yes

probably-spam #this is the mailbox in the .muttrc file

# Work around procmail bug: any output on stderr will cause the "F" in "From"

# to be dropped. This will re-add it.


  • ^^rom[]


LOG="*** Dropped F off From_ header! Fixing up. "

:0 fhw

sed -e '1s/^/F/'


If you have questions I don't mind answering if I can. Write me at the email address at the top of the page.

And yes I know this page is ugly. (smile)

  • No labels