[ale] procmailrc filters

Jason Day jasonday at worldnet.att.net
Tue Apr 15 11:54:17 EDT 2003


On Mon, Apr 14, 2003 at 02:06:34PM -0400, Christopher Fowler wrote:
> I would like to move filters from my mail program to my imap server. I'm
> using fetchmail -> procmail -> spamassasin -> INBOX.  Can I add filters
> that will filter on To: and other headers and place those emails in
> mailbox files?

I've never setup an imap server, but if by "mailbox files" you mean
mbox, then yes, procmail can do this.  Here's a sample:

--- cut here ---
PATH=/bin:/usr/bin:/usr/local/bin
MAILDIR=$HOME/Mail      #you'd better make sure it exists
LOGFILE=$MAILDIR/.fromlog   #recommended

# Spam Assassin
:0fw
| spamc

:0e
{
    EXITCODE=$?
}

:0:
* ^X-Spam-Status: Yes
caughtspam

# ALE list
:0:
* ^TO_ale at ale.org
ale
--- cut here ---

This will save any mail to the ALE list in an mbox file called ale, in
the $HOME/Mail directory.  Adjust the MAILDIR variable if you want to
save it to a different directory.

If you want to add another filter, just add an additional
:0:
* ^TO_list at whatever.com
mailbox

The ``^TO_'' is a builtin macro that procmail will expand to match the
To:, Cc:, and other headers that a mailing list would reasonably use.
Check the procmailrc and procmailex man pages for more info.

HTH,
Jason
-- 
Jason Day                                       jasonday at
http://jasonday.home.att.net                    worldnet dot att dot net
 
"Of course I'm paranoid, everyone is trying to kill me."
    -- Weyoun-6, Star Trek: Deep Space 9
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list