procmail
[Top] [All Lists]

Re: Forwarding to Perl file list

2000-08-07 14:41:14
I found this on Era's mini-FAQ.

http://www.ling.helsinki.fi/users/reriksso/procmail/mini-faq.html#forward-many

If you have a largish list of recipients, you might prefer to store the
addresses in an external file you can edit without mucking with your
Procmail filters: 

# The file $MAILDIR/addresses.txt contains the recipients, one per line
:0
* ^Subject: result from cgi-bin/www-feedback$
! `cat addresses.txt`
# ^ Make sure those ^ are backticks, BTW (ASCII 96)


On Mon, 7 Aug 2000, Eric Hilding wrote:


In trying to fine-tune the forwarding with "Old-Postmark:" recipe,
I was sent a line of perl code to hopefully complete the forwarding
processes to 5 or 10 e-mail addresses in a separate text file.

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.  I went back
in and "#'d" out all the lines to shut off the loop.

What might be needed to end the loop and just cycle through the
addresses ONE time?

Thanks for any assistance.

Eric


# 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)
 ---- actual addresses changed to eliminate spam from lurkers ----


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



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