procmail
[Top] [All Lists]

Re: How to apply multiple recipes to a single email?

2009-09-21 14:50:31
At 21:39 2009-09-21 +1000, Phill Edwards wrote:
> Use the 'f' option on your recipe. This makes the recipe a 'filter'
> that modifies the message. Then the action line pipes to 'formail'
> to add the headers.

Thanks for that. This approach makes things a little easier. I've put
my solution here for the future record. I've set up my procmailrc file
to have non-delivery filter messages like this (in the examples the
custom header "X-PMERule" is just a header I'm adding which won't
already exist in the email - PME is my initials):

BTW, You can put that header string into a variable, which makes your recipes a touch more portable for others.


  :0 wf
   # Check if email is to wife's address.
   * ^TO_wife(_at_)example(_dot_)com(_dot_)*

trailing .* is meaningless overhead - the regexp isn't anchored to the end of line, so zero or more of anything is just fine with ZERO of NOTHING.

So if someone sends an email to both of us it will get 2 custom

Though you should be aware of the procmail mantra:

        PROCMAIL IS NOT AN MTA.

Consider what happens when you receive a message which is BCC to one of you.

Ultimatley, if you're running a *nix box of your own, you should look into running your own domain and either having the mail deliver directly into the server via SMTP (versus being fetchmail'ed), or if you're on an intermittent link or dynamic IP, look into using a dynamic DNS service and set up your upline provider as a _secondary_ mailhost.

That way, mail to either of you - whether open or blind addresses - will properly arrive at the individual mailboxes.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

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