procmail
[Top] [All Lists]

Re: /etc/procmailrc vs ~/.procmailrc

2002-07-30 12:09:42

On Tue, 2002-07-30 at 04:25, Philip Guenther wrote:
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.

I do have backups of everything, even in the ~/.procmailrc files, so
losing emails should not be a problem.

Also, the office emails should generally not be on any mailing lists and
if there was an exception I could always create that in /etc/procmailrc.

if for some reason a local (imap) user account had to go through the
/etc/procmailrc first for things such as bcc, etc I could live with
that. Most of the issues I have at this time is that imap users would
have a more lenient whitelist on the spam filter than office users. That
is why I wanted to divert imap users to their ~/.procmailrc while
allowing office users to continue using /etc/procmailrc.

In short I am looking for the code that would say something like....
If A then continue, otherwise exit
(which should then send non-office email to their respective
~/.procmailrc)

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
-- 
SI Reasoning
si(_at_)mindspring(_dot_)com
gpg public key ftp://ftp.p-p-i.com/pub/si-mindspring-pubkey.asc

"When spiders unite they can tie down a lion."
- Ethiopian Proverb

Attachment: signature.asc
Description: This is a digitally signed message part