procmail
[Top] [All Lists]

Re: Forwarding to Perl file list

2000-08-07 14:45:51
| I used a test .txt file with 3 addresses in it, but what happened
| was the system just kept chunking out copies of the "Test" e-mail & 
| forwarding them to the 1st address in the .txt file.

| # FORWARD TO MULTIPLE E-MAIL ADDRESSES FROM FILE
| :0fhw
| * ^TOincoming(_at_)mydomain(_dot_)com
| | formail -R 'From ' Old-Postmark:
|  :0a
| ! `perl -pe 's/\n/ /g' < /path/file_of_addresses.txt`

| (addresses.txt file)
| address1(_at_)newdomain(_dot_)com
| address2(_at_)newdomain(_dot_)com
| address3(_at_)newdomain(_dot_)com

| (FROM THE LOG)
| Subject: Test
|  Folder: /usr/lib/sendmail address1(_at_)newdomain(_dot_)com 
address1(_at_)newdomain(_dot_)com 2049
| Subject: Test
|  Folder: /usr/lib/sendmail address1(_at_)newdomain(_dot_)com 
address1(_at_)newdomain(_dot_)com 2213
| Subject: Test
|  Folder: /usr/lib/sendmail address1(_at_)newdomain(_dot_)com 
address1(_at_)newdomain(_dot_)com 2377
| (etc., etc. until I shut off the recipe)

And it kept growing too.

Does address1(_at_)newdomain(_dot_)com by any chance equal the address where 
you're run-
ning this recipe?  If so, the routine has no loop detection.  If you want to
keep a copy at that account, either (1) add loop detection to the routine, or
(2) better [well, doing both would be better yet], take the operating address
out of the forwarding file and just keep a copy when the message first comes
in by adding a `c' flag to the recipe that sends to the perl output.

However, the repetition of the first address on each entry in the logfile
makes me wonder if the MTA, the shell, and perl are working well together.
What happens, Eric, if you replace the perl recipe with just this,

 :0a
 ! `cat /path/file_of_addresses.txt`

or this,

 :0a
 ! `tr \\12 \\40 < /path/file_of_addresses.txt`


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