Re: [exim] redirecting email to perl script

Top Page
Delete this message
Reply to this message
Author: Peter Bowyer
Date:  
To: Exim Users Mailing List
Subject: Re: [exim] redirecting email to perl script
On 22/04/05, Drav Sloan <holborn-exim@???> wrote:
> Peter Bowyer wrote:
> > > $email = <STDIN>;
> > >
> > > open (LOGGING, ">>/var/log/dnsbl_log");
> > > print LOGGING "$email\n";
> > > close LOGGING;
> > > ---end---
> > >
> > > i only get this:
> > > From root@??? Fri Apr 22 13:00:35
> > > 2005
> > >
> > > so how to get the email with it's full header?
> >
> > You need to brush up on your perl. The code you wrote grabs the first
> > line from stdin - hence your results. You need a loop to process the
> > whole stream.
> >
> > open (LOGGING, ">>/var/log/dnsbl_log");
> > while (<STDIN>) {
> > print LOGGING "$_\n";
>
> Why have a loop?
>
> { local($/) = undef; $email = <STDIN>; }
>
> (note the { }'s are important to change the scope of $/)


Like I said - 'something like....' :-)

Peter

--
Peter Bowyer
Email: peter@???
Tel: +44 1296 768003
VoIP: sip:peter@???