OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: check order possibly not honored

From: Jon (jon_kiotk.net)
Date: Sun Jul 08 2007 - 15:03:16 CDT


MrC wrote:
>
> Jon wrote:
>> I'm experimenting with a regexp reject in check_helo_access on debian
>> stable with their postfix 2.3.8-2+b1.
>>
>> I created a simple check in helo_access_regexp which contains
>> *pool* REJECT
>>
>
> This also matches "poo", "shampoo", etc. which I don't think is what you
> want.

Yes, you're right. Omitting the L wasn't what I wanted. I'm going to
have to pick up Mastering Regular Expressions because I keep getting
these wrong...

>
>> I see matches in quite a few entries in my mail.log output but
>> sometimes postgrey reacts to a 'pool' entry instead of
>> check_helo_access.
>>
>> Jul 8 13:07:31 myserver postfix/smtpd[16677]: connect from
>> pool-70-105-159-92.char.east.verizon.net[70.105.159.92]
>> Jul 8 13:07:32 myserver postfix/smtpd[16677]: NOQUEUE: reject: RCPT
>> from pool-70-105-159-92.char.east.verizon.net[70.105.159.92]: 450
>> 4.7.1 <myusermydomain.org>: Recipient address rejected: Greylisted,
>> see http://isg.ee.ethz.ch/tools/postgrey/help/mydomain.org.html;
>> from=<acacyagrnfya.com> to=<myusermydomain.org> proto=SMTP
>> helo=<ya.com>
>> Jul 8 13:07:33 myserver postfix/smtpd[16677]: lost connection after
>> RCPT from pool-70-105-159-92.char.east.verizon.net[70.105.159.92]
>>
>>
>
> The HELO hostname was "ya.com"; this clearly doesn't match your *pool* RE.
>
> MrC

Whoops... that makes complete sense... I guess I will take a break due
to burnout because I should have known better. Thank you!

>
>> Per postconf -n, I think I have postgrey as a later check than
>> helo_access_regexp.
>>
>> smtpd_client_restrictions = check_client_access
>> hash:/etc/postfix/access, check_sender_access hash:/etc/postfix/access
>> smtpd_data_restrictions = reject_unauth_pipelining
>> smtpd_delay_reject = yes
>> smtpd_helo_required = yes
>> smtpd_helo_restrictions = permit_mynetworks, check_helo_access
>> regexp:/etc/postfix/helo_access_regexp, check_helo_access
>> hash:/etc/postfix/helo_access_hash, reject_unknown_helo_hostname,
>> reject_unknown_hostname, reject_non_fqdn_helo_hostname,
>> reject_invalid_helo_hostname
>> smtpd_recipient_restrictions = permit_mynetworks,
>> reject_unauth_destination, reject_unknown_reverse_client_hostname,
>> reject_unknown_sender_domain, reject_invalid_hostname,
>> reject_non_fqdn_recipient, reject_non_fqdn_sender,
>> reject_unknown_recipient_domain, check_recipient_access
>> hash:/etc/postfix/access, reject_unlisted_recipient,
>> check_policy_service inet:127.0.0.1:60000
>> smtpd_sender_restrictions = permit_mynetworks, reject_non_fqdn_sender,
>> reject_unknown_sender_domain
>>
>>
>>
>> I understand that *pool* might not be the most beneficial regular
>> expression ever created and might be considered too dangerous by most
>> but this check seems to match other log entries that begin with pool*
>> so I'm not understanding. Why would postgrey hit on this particular
>> connect but the regexp hits on the other entries?
>>
>> I do have postgrey as a later check, don't I?