Re: [exim] Regex Help

Top Page
Delete this message
Reply to this message
Author: David Saez Padros
Date:  
To: Marc Perkel
CC: exim-users
Subject: Re: [exim] Regex Help
Hi !!

> Need a quick regex to look at the sender host name and see if it looks
> like a dynamic IP address. I'm sure there must be one floating around
> somewhere.


I use this one:

# Dial-up/cable/dsl check

dialup_acl:

   accept  condition      = ${if def:acl_c3}
           condition      = $acl_c3


   deny    condition      = ${if def:acl_c3}


   accept  acl            = raw_dialup_acl
           set acl_c3     = yes


   deny    set acl_c3     = no


raw_dialup_acl:

# Known not dialup hosts

   deny    hosts         = *.amazon.com:*.yahoo.com:*.hotmail.com


# Get hostname on acl_c4

   warn    condition     = ${if !def:acl_c4}
           condition     = ${if eq {$sender_host_name}{}}
           set acl_c4    = ${lookup 
dnsdb{defer_never,ptr=$sender_host_address}\
                            {${lc:$value}}{}}


   warn    condition     = ${if !def:acl_c4}
           set acl_c4    = ${lc:$sender_host_name}


   accept  condition     = ${if eq {$acl_c4}{}}


   accept  condition     = ${if match {$acl_c4}\
                           {\N\b[a-z]*?(\d{1,3}[\.\-x]\d{1,3}|\
([a-z]?dsl(am)?|dhcp|tnt|ipt|pool|nas|cvx|leased|\
slip|user|subscriber|d[iu]p|modem(cable)?|ppp(oe)?|\
dyn(amic)?|dial(up|in)?|cust(omers?)?|(end)?users?|\
d?cliente?)\d*?)\b\N}}


   accept  condition     = ${if match {$acl_c4}{\N\d{5,}\N}}


   accept  condition     = ${if match {$acl_c4}\
{(comcast\.net|ips\.sarenet\.es|prod-empresarial\.com\.mx|\
rodos\.acn\.gr|res\.rr\.com|ks\.charter\.com|\
abi\.uni2\.es|e\.brasiltelecom\.net\.br|\
bigpond\.net\.au|ip\.fastwebnet\.it|\
miyagi\.ocn\.ne\.jp|telecom-bg|speed\.planet\.nl)\$}}


   accept  dnslists      = dnsbl.sorbs.net=127.0.0.10:\
dialup.blacklist.jippg.org:dynablock.easynet.nl


deny

-- 
Best regards ...
----------------------------------------------------------------
    David Saez Padros                http://www.ols.es
    On-Line Services 2000 S.L.       e-mail  david@???
    Pintor Vayreda 1                 telf    +34 902 50 29 75
    08184 Palau-Solita i Plegamans   movil   +34 670 35 27 53
----------------------------------------------------------------