Autor: Peter Bowyer Fecha: A: Exim Users Mailing List Asunto: 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 $/)