procmail
[Top] [All Lists]

Re: Forwarding to Perl file list

2000-08-07 17:00:48
At 17:35 2000-08-07 -0500, David W. Tamkin wrote:
[snip]

I think we do have a loop here: somehow it is coming back to the address
that runs the recipe.  Sean Straw's advice to make the Old-Postmark: line
do double duty as a loop detector was very good:

Uhm, actually, I wasn't suggesting to use that -- a REAL X-loop is better, but for the quick perl/forward test _while modifying the rule to a minimum_, all I needed was to check to see if the Old-Postmark was present (since it isn't present on any other messages I get), and if so, not subject it to the rule again - my mention of the fact that I used the old-postmark header was merely to be true to describing what I'd done, even if it wasn't a complete loop implementation. It was just a matter of adding in one inverted match condition line, instead of that, plus additional args to formail.

Properly written, the recipe should be more like:


#VERBOSE=ON

:0fhw
* ^TOincoming(_at_)mydomain\(_dot_)com
* !^X-Loop: incoming(_at_)mydomain\(_dot_)com
* !^FROM_DAEMON
| formail -R 'From ' Old-Postmark: \
 -A"X-Loop: incoming(_at_)mydomain(_dot_)com"

:0a
! `perl -pe 's/\n/ /g' < /path/file_of_addresses.txt`

#VERBOSE=OFF


Since the perl expression worked fine for me, and since the _real_ trick to fixing the problem had to do with checking for loops (as has subsequently been proven by a confirmation that adding the loop check fixed the problem), I'm specifying the perl versus the cat or tn delivery rules.

Additionally, Mailer-Daemon messages are also checked for (actually, in my environ, I check for them in one place near the top of my rules, and deposit mailer-daemon messages into a folder, aleiviating the need to check for daemons in each recipe, but a self-standing recipe such as this one should have it), at least if this TO address is ever used to send things from (and even then, which some of the braindead MTAs out there, checking for it is simply good practice).

Loop checking and daemon checking are both important things to do for any messages which are forwarded rather than simply stored.

---
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395


_______________________________________________
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>