procmail
[Top] [All Lists]

Re: Passing message body to a perl script

2001-05-12 08:31:59
Hi,
I had a similiar problem and I recieved help from members of this list.
This is what I have done to achieve this:

setup a fifo:
mkfifo .mailfifo
or
mknod .mailfifo p

setup procmail recipe:
:0:
* ^To:.*redhat-list
| formail +1 -dsc > /home/mark/.mail.fifo

start perl script like this:
#!/usr/bin/perl -w

while(1){
   open (FIFO,"<  /home/mark/.mail.fifo") or die $!;
    while (<FIFO>){
         #Whatever you want to do with the mail
   }
   close FIFO;
}

You'll have to figure out a way to make sure the perl script is running
when your mail arrives. I'm not sure exactly waht happens if the script is
not running. I guess your mail would be lost?

Hope this helps,
Regards,
Mark Irvine

On Wed, 9 May 2001, S M wrote:

MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

hello all

I want to pass the entire message body to a perl
script from a procmail recipe.
How should i go abt...Can anyone give me lead.....

thanks in advance

SM

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
_______________________________________________
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>