Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Apr 2003 17:53:41 -0400
From:      "Dan Langille" <dan@langille.org>
To:        freebsd-chat@freebsd.org
Subject:   foo+bar@ addresses, procmail, and postfix
Message-ID:  <3E930CA5.30714.112296A7@localhost>

next in thread | raw e-mail | index | archive | help
I'm trying to get foo+bar@example.org addresses to work with 
procmail.  My MTA is postfix.  I've had a hard time tracking down the 
information and trial and error has gotten me a working solution.  
I'm wondering if there is a better way to accomplish this[1].

This type of addressing is often referred to as address extensions.  
I found one clue at http://pm-doc.sourceforge.net/pm-tips-
body.html#using_plus_addressing_foobar.  My problem was that I could 
not get the "bar" bit of the address.  But the above URL mentions:

"When you receive message from any of these mailing lists to your 
login account, the list.procmail is already in variable $1 and the 
recipe to sink all mailing lists to their individual folders is very 
simple: "

The problem was to get a value in $1.  The only solution I could see 
was to resort to "Using Procmail for system-wide local delivery" as 
found at http://www.postfix.org/faq.html#procmail.  I now have this 
entry in my postfix config file:

mailbox_command = /usr/local/bin/procmail -t -a "$EXTENSION"

This test procmail recipie now works:

ARG = $1

:0
$ARG

Mail to foo+bar@ gets put into the bar folder.

Any comments?  Ideas?  Improvements?

[1] - with the tools mentioned.  Those suggesting a change of MTA 
will be beaten to death with spam.
-- 
Dan Langille : http://www.langille.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E930CA5.30714.112296A7>