On Tue, Mar 19, 2019 at 02:46:02PM -0400, Viktor Dukhovni wrote:
> > it turns out that this usage of `var_message_limit` is missing the check
> > of `var_message_limit > 0` that in other places enables `0` to mean
> > "no limit", and thus it enforces a limit of 0 with my config :(
>
> Correct. The code should read:
>
> --- src/smtpd/smtpd.c
> +++ src/smtpd/smtpd.c
> @@ -3878,7 +3878,8 @@ static int bdat_cmd(SMTPD_STATE *state, int argc,
> SMTPD_TOKEN *argv)
> }
> }
> /* Block too large chunks. */
> - if (state->act_size > var_message_limit - chunk_size) {
> + if (var_message_limit > 0
> + && state->act_size > var_message_limit - chunk_size) {
> state->error_mask |= MAIL_ERROR_POLICY;
> msg_warn("%s: BDAT request from %s exceeds message size limit",
> state->queue_id ? state->queue_id : "NOQUEUE",
Note that, perhaps unintentionally, the treatment of "message_size_limit
= 0" is not documented to mean "no limit". Perhaps we should also
address that.
--
Viktor.