procmail filtering postfix deliveries

Chris G cl at isbd.net
Mon Sep 6 09:54:26 UTC 2010


On Mon, Sep 06, 2010 at 09:36:42AM +0100, David Fletcher wrote:
> This is driving me nuts so I thought I'd ask here.
> 
> The email arrangement on my server used to be to use fetchmail to download 
> over POP3 which passed messages to procmail using /etc/procmailrc which 
> filtered out any rubbish I don't want to see from certain well defined 
> sources then delivered into mail boxes. This worked OK but was messy.
> 
> I now have my MX record pointing to my server at home. Messages are sorted 
> into maildir boxes by postfix using the aliases and it works beautifully. I'm 
> using dovecot-imapd to access my mail.
> 
> What I cannot now get to work is filtering using procmail. With a 
> ~/.procmailrc file it either doesn't work or produces an email loop.
> 
> I'm using plain Ubuntu Lucid Server with no desktops on this machine.
> 
> I would like to know, does anybody here have the MX->postfix->procmail filter 
> arrangement working, and if so could they please let me have an example or 
> two of what they have done or some tips I can use?
> 
Don't you just set up a .forward file in your home directory so that
postfix delivers the mail to procmail?  I have this sort of a set up
except that it doesn't use procmail it uses a python script I wrote
myself. 

Set up postfix to deliver your mail normally (i.e. don't tell it to
use procmail) and create a .forward file to feed the mail into
procmail.   My .forward file is simply:-

    | /home/chris/bin/filter.py

I guess yours would need to be:-

    | /usr/bin/procmail

-- 
Chris Green




More information about the ubuntu-users mailing list