Re: [exim] redirecting email to perl script

Inizio della pagina
Delete this message
Reply to this message
Autore: Peter Bowyer
Data:  
To: Exim Users Mailing List
Oggetto: 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@???