OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
pcre:table & client_restrictions

From: Eugene V. Boontseff (eugenehome.wdc.spb.ru)
Date: Sat Nov 21 2009 - 06:56:12 CST


Dear colleagues,

kindly looking for your assistence in the following matter.
To cut off the spamers, I intended to use pcre:table.

main.cf :

<cut on>
...
smtpd_client_restrictions =
        check_client_access pcre:/usr/local/etc/postfix/exper,
...
<cut off>

eugenemail [/usr/local/etc/postfix]# cat exper
/(.*(\d{1,3})[\.-](\d{1,3})[\.-](\d{1,3})[\.-](\d{1,3}).*\[.*(?:\3\.\2|\2\.\3.*).*\].*)/

               554 5.7.1 Dynamic sender $1, please, use SMTP server of
your provider
/pppoe/ REJECT pppoe # It's for debugging

eugenemail [/usr/local/etc/postfix]# postmap -fq
"<ppp92-100-127-177.pppoe.avangarddsl.ru[92.100.127.177]" pcre:exper
554 5.7.1 Dynamic sender
<ppp92-100-127-177.pppoe.avangarddsl.ru[92.100.127.177], please, use
SMTP server of your provider

so the postmap shows that the first line is working

eugenehome [/home/eugene]> telnet some.mail.host 25
Trying aa.bbb.ccc.dd...
Connected to some.mail.host.
Escape character is '^]'.
554 5.7.1 <ppp92-100-127-177.pppoe.avangarddsl.ru[92.100.127.177]>:
Client host rejected: pppoe

the debuging rule is working instead the of first one.

Why does the postfix ignore the first rule?

--
Eugene