Re: [exim] REGEX help - Picking IP addresses out of Received…

Top Pagina
Delete this message
Reply to this message
Auteur: Marc Perkel
Datum:  
Aan: Dan_Mitton
CC: exim users
Onderwerp: Re: [exim] REGEX help - Picking IP addresses out of Received Headers


Dan_Mitton@??? wrote:
> This might be getting close...
>
> If you pipe in a list of new-line separated 'Received' headers in this
> Perl script:
>
> $foo="";
>
> while (<STDIN>)
> {$foo .= $_};
>
> $foo =~ s/(from .*?\(\[)(.*?)(\]\).*?$)/$2/gm;
> print $foo;
>
> it will output a new-line separated list of IP addresses.
>
> Does that help at all??
>
>
>


What I was looking for was an Exim ACL that would say grab the second
one and put it into one variable and then write another regex to get the
third one into a variable, etc. Then I'd use the contents of the
variable to do a blacklist lookup. I'm not sure how I would use a perl
script to do it.