Comment 131 for bug 1215882

Revision history for this message
In , Alex Henrie (alexhenrie24) wrote :

Created attachment 8801912
[PATCH] Gracefully handle SMTP servers that send a bad greeting and hang up.

This patch fixes the problem. It was really hard for me to wrap my head around this code, so feedback is appreciated. Right now m_sendDone == m_nextStateAfterResponse == SMTP_DONE || m_nextStateAfterResponse == SMTP_ERROR_DONE, and I decided to not change that. Keeping the existing m_sendDone semantics allowed me to fix (without duplicating code) the related case where there is a network failure (not a clean hangup) while sending QUIT after an error.

Instead of showing a second error dialog for NS_ERROR_NET_INTERRUPT like in old versions of Thunderbird, I chose to set NS_ERROR_BUT_DONT_SHOW_ALERT because one error dialog is enough, and the NS_ERROR_NET_INTERRUPT dialog was not helpful: "The message could not be sent because the connection to Outgoing server (SMTP) smtp.umail.utah.edu was lost in the middle of the transaction. Try again."

Users will still get an NS_ERROR_NET_INTERRUPT dialog as long as the interruption didn't happen while trying to gracefully shut down after a previous error.

https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=bf65cbeb6018