OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: "warn_if_reject reject_unlisted_recipient" breaks subsequent "reject_unlisted_recipient"

From: Wietse Venema (wietseporcupine.org)
Date: Wed Apr 09 2008 - 07:35:28 CDT


John Tobin:
> G'day all,
>
> On our mail system I want to list every restriction we use in
> smtpd_recipient_restrictions twice: once with warn_if_reject, and once
> without. This will allow me to see all the restrictions that would have
> caused a rejection, not just the first.
>
> This works properly for everything except reject_unlisted_sender and
> reject_unlisted_recipient - when I have
> warn_if_reject reject_unlisted_recipient, reject_unlisted_recipient
> in smtpd_recipient_restrictions unknown recipients are not rejected.

That's a bug. The code that implements reject_unlisted_recipient
is skipped if it has somehow already executed for that recipient.

To fix this, it not only has to remember that a test was done,
but also remember the result of that test. That's a but more
change than I am comfortable with doing just on the spot.

        Wietse