[exim-dev] Re: is this right?

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Jeremy Harris
Datum:  
To: exim-dev
Betreff: [exim-dev] Re: is this right?
On 03/07/2024 02:03, Jasen Betts via Exim-dev wrote:
> src/src/transports/smtp.c areound line 4500 says:
>
>
> /* If the peer closed the TCP connection after end-of-data, but before
> we could send QUIT, do TLS close, etc - call it a message error.
> Otherwise, if all the recipients have been dealt with, call a close no
> error at all; each address_item should have a suitable result already
> (2xx: PENDING_OK, 4xx: DEFER, 5xx: FAIL) */
>
> if (!(message_error = Ustrncmp(smtp_command,"end ",4) == 0))
>
>
> Is that test supposed to have both "== 0" on the end and "!" on the front?
> It does not seem to match the comment.


My read of it, just now, is "yes it is (supposed to...)".

We're in a case choice for an errno setting that is used to flag a peer-close detection.
The strncmp==0 establishes that we have reached end-of-data.
We set the boolean variable "message_error" based on that.

If it is not a message_error here (so, was not at end-of-data in the SMTP conversation)
we do stuff corresponding to the "Otherwise" of the comment: "call it (the peer close)
not an error" IF all address_item has a suitable result (which they should). In other
words, don't bitch about a non-conforming peer that fails to properly close off the
SMTP conversation.

Should the "all have a suitable result" not hold for some reason, carry on in the
error processing path (though we've decided it's not a "message_error").
--
Cheers,
Jeremy


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-dev-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/