procmail
[Top] [All Lists]

Re: Comparing with a file contents to forward mail

2003-01-23 16:12:04
On 23 Jan, Antonio Mollinedo wrote:
| Hi,
|       I'm trying to implement a procmail recipe to do the following:
| 
| a) extract the field To: from the mail header
| b) find the right entry into a file that maps user mailboxes to the To:
| field contents
| c) deliver the mail into the corresponding user mailbox
| 
|       I've tried with several recipes found out there, without final success.
| Some help in how to do that would be very appreciated.
| Many thanks in advance

It's not completely clear what you want to accomplish, but no matter
what it is, if you plan on using the To: header for routing mail, it's
destined to fail.  The content of the To: header doesn't necessarily
correspond to the actual recipient.  Take a look at this message.  It
got to you (presumably) but your address isn't anywhere in the To: (nor
the Cc:) header.  Further, there can be multiple recipients in the To:
header.  It's not plausible that you could reliably map every
conceivable combination and contortion of the To: header to a user
mailbox. [1]  It requires information passed at the MTA level to route
mail.  Without special configuration, that information is lost by the
time it gets to procmail.

If you're talking about users with multiple email addresses, then you
want to look at aliases.  If you're talking about splitting up a
multi-drop box amongst different users, have a look at:

http://www.sektorn.mooo.com/era/procmail/mini-faq.html#bcc-explanation
http://www.ii.com/internet/robots/procmail/qs/#virtualDomain


[1] It IS plausible to map ONLY specific addresses and discard the
others, but then how do you handle multiple valid recipients? This is a
job best left to the MTA (sendmail, postfix, etc.) which has all the
necessary information; or requires the configuration of the MTA to
provide that information to you in a special header.

-- 
Email address in From: header is valid  * but only for a couple of days *
This is my reluctant response to spammers' unrelenting address harvesting



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>