After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 341579 - better SMTP error messages
better SMTP error messages
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
1.6.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
: 332939 364248 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-05-12 19:40 UTC by Jeffrey Stedfast
Modified: 2008-06-26 12:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed eds patch (2.16 KB, patch)
2007-12-11 10:49 UTC, Milan Crha
none Details | Review
proposed eds patch ][ (3.73 KB, patch)
2007-12-14 18:06 UTC, Milan Crha
committed Details | Review

Description Jeffrey Stedfast 2006-05-12 19:40:05 UTC
The current SMTP code will use an error string taken from rfc0821 (matched against the actual numeric error code) in the cases where the server does not support the ENHANCEDSTATUSCODES extension... these error messages are often cryptic to users.

It might be useful to extract the error strings that may appear after the numeric error code in much the same way as the ENHANCEDSTATUSCODES code does (which may or may not work depending on the user's locale charset matching the server charset needed for conversion to UTF-8 - I wonder if the ENHANCEDSTATUSCODES code handles this properly and if we can just do what it does?).
Comment 1 David Woodhouse 2006-05-12 21:19:12 UTC
RFC2821 is clear that commands and responses are ASCII. If you encounter a server which gives a non-ASCII response, it is quite simply broken. 

Appendix A:
   The TCP connection supports the transmission of 8-bit bytes.  The
   SMTP data is 7-bit ASCII characters.  Each character is transmitted
   as an 8-bit byte with the high-order bit cleared to zero.  Service
   extensions may modify this rule to permit transmission of full 8-bit
   data bytes as part of the message body, but not in SMTP commands or
   responses.

Of course, it's good to make a best-effort in the case of broken servers, but you don't have to beat yourself up about it. I'd suggest that we should do it like this:

1. If it's valid UTF-8 (which includes ASCII), treat it as such.
2. Else, if the user's local charset is not UTF-8, assume the message is in the user's local charset. This is a reasonable guess because people will often be using an SMTP server which is set up for them by someone who speaks the same language (and uses the same charset).
3. Else, assume ISO8859-1 -- in the absence of anything better to do.
Comment 2 Jeffrey Stedfast 2006-05-15 13:36:53 UTC
yea, that follows what I had ben thinking too.
Comment 3 Milan Crha 2007-12-11 10:49:17 UTC
Created attachment 100754 [details] [review]
proposed eds patch

for evolution-data-server;

Say something like this? I really do not care about other character sets, the most worst thing which can happen is the text in dialog will be broken, but it's fault of SMTP server, because of the RFC: command response uses 7-bit encoding. (or something like that there)
Comment 4 Jeffrey Stedfast 2007-12-11 17:40:53 UTC
this patch looks ok so long as it works (I can't test it)
Comment 5 Milan Crha 2007-12-13 09:25:17 UTC
That's my problem, too, I cannot test it properly either (I tested only on some fake error, when I did lye that there was an error, but it's not the same).
David, are you able to try and test it for us?
Comment 6 David Woodhouse 2007-12-13 15:24:02 UTC
Not right now; I'm kind of busy. Maybe in a week or two.

Better still, point it at one of my machines like bombadil.infradead.org and do naughty things (like having an underscore in your HELO), and check you get told to sod off correctly :)

It won't take much for me to tune the error messages and even (temporarily, since it's an RFC violation) put UTF-8 or legacy charsets in them. I can do that while you test, if you like?
Comment 7 Milan Crha 2007-12-14 18:06:53 UTC
Created attachment 100966 [details] [review]
proposed eds patch ][

for evolution-data-server;

after a testing with David's help, we got this patch as result of our work.
Comment 8 David Woodhouse 2007-12-14 18:32:26 UTC
Although Milan's patch works fine, it highlights a problem which already existed elsewhere. When HELO fails, Evolution silently ignores the error and continues.

So imagine the following SMTP conversation:

<< 220 ESMTP
>> HELO [10.0.0.1]
<< 451-Sorry, this server is currently down for maintenance.
<< 451-Scheduled maintenance downtime is on the last Friday of each month,
<< 451 between the hours of 22:00-23:00 UTC.
>> MAIL FROM:<dwmw2@infradead.org>
<< 550 You must identify yourself with HELO or EHLO before sending mail


Evolution will currently report that final error message, instead of the more useful first error.
Comment 9 Srinivasa Ragavan 2007-12-19 07:49:44 UTC
Milan, you want to debug more into the later issue or push this atm and work more?
I would leave the call to you.
Comment 10 Milan Crha 2007-12-19 14:54:15 UTC
We had a chat with David that day before he wrote it here, it will be a new bug (hint David), and I will commit this today.
Comment 11 Milan Crha 2007-12-19 15:00:40 UTC
Committed to trunk. Committed revision 8305.
Comment 12 Milan Crha 2007-12-21 10:49:25 UTC
For thing in comment #8 created bug #504837.
Comment 13 Akhil Laddha 2008-01-31 12:16:01 UTC
*** Bug 332939 has been marked as a duplicate of this bug. ***
Comment 14 Cosimo Cecchi 2008-06-26 12:58:37 UTC
*** Bug 364248 has been marked as a duplicate of this bug. ***