Re: [exim] extract ip from Received lines in ACL

Top Page
Delete this message
Reply to this message
Author: Mike Cardwell
Date:  
To: exim-users
Subject: Re: [exim] extract ip from Received lines in ACL
Peter wrote:

> On my system most spam/scams that escapes filter comes from freemail
> addresses, and i would like to filter harder on mail that comes from
> countrys like Nigeria, China etc. Hotmail and others have
> X-Originating-Ip: header that i can use, but yahoo puts ip in received:
> header, is it possible to grep the ip from the last received line within
> a acl?, like this
> Received: from [81.91.232.194] by web37004.mail.mud.yahoo.com via HTTP;
> Sat, 12 Sep 2009 21:15:38 PDT


Probably something like this?

set acl_m_ip = ${if match{$h_Received:}{\N.+ from \[([0-9\.]+)\] by
web[0-9]+\.mail\.mud\.yahoo\.com via HTTP\N}{$1}{}}

--
Mike Cardwell - IT Consultant and LAMP developer
Cardwell IT Ltd. (UK Reg'd Company #06920226) http://cardwellit.com/