Re: [exim] redirecting email to perl script

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Drav Sloan
Date:  
À: peter
CC: Exim Users Mailing List
Sujet: Re: [exim] redirecting email to perl script
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 $/)

D.