On Tue, May 29, 2001 at 09:33:12AM +0700, Metee Khanongnuch wrote:
> qmail-ldap-1.03-20010501.patch (and old patch) has something incorrect.
> It swap condition between line 12486 and line 12488
>
>
> Line : 12486
> + if (!addr.s[0] || !str_diff("#@[]", addr.s)) /* if (!addr.s[0]) */
> <--- This should be line 12488
> + {
> + if (!str_diff("NOBOUNCE", denymail))
> <--- This should be line 12486
> + {
> + why = "refused to accept RFC821 bounce from remote";
> + flagbarf=1;
> + }
> + }
> + else
>
>
> The correct code as following.
>
> Line : 12486
> + if (!str_diff("NOBOUNCE", denymail))
> + {
> + if (!addr.s[0] || !str_diff("#@[]", addr.s)) /* if (!addr.s[0]) */
> + {
> + why = "refused to accept RFC821 bounce from remote";
> + flagbarf=1;
> + }
> + }
> + else
>
The two sollutions (original and your patch) are equal.
The logic is: if NOBOUNCE and ("no fromaddr" or "fromaddr = #@[]") then
deny.
It doesn't matter if you check for NOBOUNCE or for
(!addr.s[0] || !str_diff("#@[]", addr.s)) first.
It is also possible to write all on one line:
if ( ( !addr.s[0] || !str_diff("#@[]", addr.s) ) && !str_diff("NOBOUNCE", denymail) ) {
why = "refused to accept RFC821 bounce from remote";
flagbarf=1;
}
The bug has to be somewhere else.
--
later
Claudio
mailto:[EMAIL PROTECTED]