On Wed, May 07, 2014 at 08:33:18PM +0200, Sebastian Nielsen wrote:

> I know. "check_sender_access" does always check MAIL_FROM, regardless of in
> which access context they are in. (else it would be check_recipient_access
> or check_client_access)

When using "check_sender_access" use a separate lookup table whose
keys are sender addresses/domains, DO NOT use a single generic file
called "access" for everything.  This just leads to trouble.

> But a sender access policy cannot contain a recipient policy (like
> reject_unauth_destination) because MAIL_FROM comes before RCPT_TO (unless
> smtpd_delay_reject is set to yes)

You SHOULD have smtpd_delay_reject set to "yes".

> Did test the policy carefully both using a external tool (that queries the
> server externally) and internally, and all test cases did pass thorugh with
> the result I wanted.

Sure, it works now, but it is fragile, and will land you or your
successor in trouble some day.

> This tool is GREAT to test complex relay restrictions:
> http://smtper.nanogenesis.fr/

Tests only report things that are already broken.  Only
design reviews report things that are fragile.

> Of course, I will never put anything else than something I want to relay, in
> the "access" file, eg only "permit_mynetworks" and such.

Some day you will forget, or someone else won't know the constraints.

-- 
        Viktor.

Reply via email to