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

Pàgina inicial
Delete this message
Reply to this message
Autor: Marc Perkel
Data:  
A: Dan_Mitton
CC: exim users
Assumpte: 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.