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, Markus Hardiyanto <informatics2k1@???> wrote:
> here is my script:
> ---begin---
> #!/usr/bin/perl
>
> $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";
}


Or something similar. Completely untested, may be dangerous for young
children and the elderly.

Peter