16-04-14 9:16 AM, Wietse Venema wrote:
Wietse Venema:
John Allen:
Is there a way of negating a smtpd condition.
For example if I were to apply c "check_sender_access sql_lookup" under
submission in master.cf would it be possible to say something like
!check_check_acess ... under smtpd restrctions

The idea being that if example.com is allowed access via submission they
are denied access via  smtpd.
The Postfix design is not optimized for negation.

You could use pipemap:{sql_lookup, map-that-replaces-permit-with-reject},
plus a static:reject map to provide the answer if there was none in the
original map.

check_something_access unionmap:{
     pipemap:{
        sql_lookup,
        map-that-replaces-permit-with-reject
     },
     static:{reject and this is why}
}

Requires Postfix 3.0 or later.
First fix: we must not use union_map  because it can return multiple
results.

     check_something_access pipemap:{
       sql_lookup,
       map-that-replaces-permit-with-reject
     }

A further simplification is possible if sql_lookup returns only "permit"
results. In that case we can return a fixed "reject" response instead:

     check_something_access pipemap:{
       sql_lookup,
       static:{reject Please use server port 587/submission}
     }
Still not as simple as negation. BTW, line breaks are optional.

        Wietse
Thanks for the response. But yet again I suspect I am over thinking the solution to my "problem", its becoming a bad habit of mine.


Reply via email to