procmail
[Top] [All Lists]

Re: /etc/procmailrc vs ~/.procmailrc

2002-07-30 02:30:19
SI Reasoning <si(_at_)mindspring(_dot_)com> writes:
for my /etc/procmailrc I want to qualify it by domain, otherwise I want
it to skip to ~/.procmailrc.

For instance within /etc/procmailrc
if Delivered_to = *@(xxx|yyy|zzz).com then (continue with
/etc/procmailrc)
otherwise skip to ~/.procmailrc

How can I do this?

The name of the user being delivered to can be found in the LOGNAME
variable.  You'll note that this does _not_ include the domain used to
deliver to that user.  Since there may not be (some would say "probably
isn't") a mapping from user to domains, the only completely reliable
method of getting that info into procmail is by having the MTA pass it in.
The "sometimes works, sometimes doesn't, may give the *wrong* answer"
method is to look for the user being delivered to in the addresses in
the header and extract the domain from that.  Of course, that doesn't
work with mailing lists, or aliases, or bcc's, or resent messages,
or messages sent to the same username in two different domains, or...

In general, logic and routing related to domains should be done or at
least instigated in the MTA.  Once it gets out the MTA, you've lost
information that you can't, in general, get back.


SI Reasoning
si(_at_)mindspring(_dot_)com
gpg public key ftp://ftp.p-p-i.com/pub/si-mindspring-pubkey.asc
...
<23 lines of text unrelated to procmail>

Um, do you include all those quotes (three times as many lines as your
question) on every paper document you sign?  If not, how/why is email
different from paper?


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