Closed pprindeville closed 11 years ago
We are generating the initial message. We are not altering anything. Then, I think that's fine. For now, it works properly. I'm sure sure that's worth trying to change the behavior to gain an non-significant amount of bytes.
From is still relevant because emails are usually stored in /var/mail/username in mbox format on Unix by default and using that encoding will avoid an alteration of the email while storing it to that location.
Moreover, I'm also using quoted printable for headers encoding an other constraints will apply in that case.
My question is the following: What do you want to improve by changing the behavior of that encoding?
I'm not really worried about the number of bytes.
I just don't see the point of making a conservative workarounds for 2 scenarios which are almost certainly overtaken by events.
I personally haven't seen an EBCDIC terminal in more than 22 years.
The last commercial X.400 email services I knew of (Transpac, Compuserve, and HP OpenMail) all died more than a decade ago. Even Exchange support for X.400 was dropped in 2007.
Everything speaks NVT/US-ASCII/UTF-8 these days.
Thanks for your concern but that might be a dangerous change. Especially, see restriction on RFC 2047, page 6. It just works. Don't break it.
Again, my question is: What do you want to improve by changing the behavior of that encoding?
RFC 2047, page 6, is about headers. I'm talking about encoding the message body.
No such restrictions apply to the body.
Also, the title of that RFC is "MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text"... All of the characters above (EXCLAMATION POINT, AMPERSAND, UNDERSCORE, etc) are ALL ASCII text, so what's the relevance of Non-ASCII text to this issue?
Sure but I use one unique encoding method that works for both. It helps having something stable.
I quote again my question: What do you want to improve by changing the behavior of that encoding?
As a S/W engineer and protocol developer I like being able to read raw messages and diagnose issues; this is why SMTP + RFC-2822 is so much better than X.400 and ASN.1... I don't need a scope or a protocol analyzer to troubleshoot it.
The minute that the encoding starts getting gummed up with excessive escaping then it becomes harder to read and troubleshoot.
The only non-control ASCII characters that need to be hexified are '=' and DEL, from a minimalist encoding perspective. Encoding curly braces and tilde might help with EBCDIC... if you actually have an EBCDIC gateway to deal with (and even if you do, the burden should be on them to do the proper transcoding, not us).
I'm looking at all of the characters that get written in hex in mailmime_quoted_printable_write_driver() and it seems that this routine is overly aggressive (or pessimistic) in what gets rewritten:
int mailmime_quoted_printable_write_driver(int (* dowrite)(void , const char , size_t), void * data, int * col, int istext, const char * text, sizet size) { ... case '!': case '"': case '#': case '$': case '@': case '[': case '\': case ']': case '^': case '`': case '{': case '|': case '}': case '~': case '=': case '?': case '': case 'F': /_ there is no more 'From' at the beginning of a line / r = write_remaining(do_write, data, col, &start, &len); if (r != MAILIMF_NO_ERROR) return r; start = text + i + 1;
I'm not sure why anything OTHER than '=' needs to be escaped?
All of these are 7-bit safe characters from NVT.
I'd be inclined to remove everything but '='.
As that's all that's really required. Per RFC-2045, section 6.7 "Quoted-Printable Content-Transfer-Encoding":
Although reading RFC-1521 (now obsolete), "Appendix B -- General Guidelines For Sending Email Data" says:
Are we really worried about EBCDIC and X.400 compatibility???? This section continues as:
Please note that the above list is NOT a list of recommended practices for MTAs. RFC 821 MTAs are prohibited from altering the character of white space or wrapping long lines. These BAD and illegal practices are known to occur on established networks, and implementations should be robust in dealing with the bad effects they can cause.
Given that converting punctuation into HEX is NOT a recommended practice, why are we doing it anyway?
Some of these concerns were a lot more relevant in 1993 when this was written. These days the "^From " bugs, etc. are anachronisms.