foo+bar@ addresses, procmail, and postfix

Dan Langille dan at langille.org
Wed Apr 9 14:40:58 PDT 2003


On 8 Apr 2003 at 17:42, Terry Lambert wrote:

> Dan Langille wrote:
>
> > Any comments?  Ideas?  Improvements?
> 
> Don't run procmail globally.  Replace your mail.local, if you
> need to, but don't run procmail globally.

I found something which I think will work.  I spent some time reading 
http://www.postfix.org/local.8.html.  Often the problem associated 
with man pages is although they document features, the implications 
and interpretation of that documentation is often beyound the grasp 
of those unfamiliar with the product.  What is lacking is practical 
examples. In combination with mailing list archives, I found  
something which I think might work well without requiring global      
procmail.  From the section titled EXTERNAL COMMAND DELIVERY, 
I found references to the environment variable EXTENSION.

After some trial and error, I created a ~/.forward file which 
contains the following:

"|exec /usr/local/bin/procmail -a ${EXTENSION} || exit 75"

~/.procmailrc then contains the following (after the usual 
~/.procmailrc preamble) :

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

ARG = $1

:0
$ARG

The above is just a simple proof-of-concept script.

- Mail sent to foo+bar into the bar directory
- Mail sent to foo+test into the test directory

No more global procmail.

Thanks for the push.
-- 
Dan Langille : http://www.langille.org/



More information about the freebsd-chat mailing list