0 votes

I noticed that getting a relay disallowed error with Zoho causes a 'Tried to read a line' error in Mail.dll, instead of the SmtpResponseException that I would have expected.

Here's the log:

Mail.dll: 26 11:48:14 S: 553 Relaying disallowed
Mail.dll: 26 11:48:14 C: RSET
A first chance exception of type 'Limilabs.Client.ServerException' occurred in Mail.dll

It seems the RSET command, Mail.dll is sending, is not receiving the reply it expects, so it throws the ServerException, but shouldn't it have thrown the relaying exception instead? Or, actually, since it's while sending, not thrown anything but set the SendMessageStatus correctly? So the developer (me) knows what the error is instead of getting the generic 'Tried to read a line' error.

by

1 Answer

0 votes

SMTP specification (RFC 2821) is clear:

"The receiver MUST send a "250 OK" reply to a RSET command with no
arguments."

If the RSET command was successful (as it should have been), correct SendMessageStatus (containing "553 Relaying disallowed" error) would be returned.

Most likely the server disconnects after receiving RSET command. This is a violation of SMTP protocol, RFC 2821:

"An SMTP server MUST NOT close the connection as the result of receiving a RSET"

...and this must be reported to the client using an exception ('Tried to read a line').

RSET must be send, so Smtp object is in correct state. Incorrect response, no response, or connection failure must be reported back to the client.

by (297k points)
...