-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of RFC 6532 sends email without activating SMTPUTF8 #224
Comments
Is this ever going to be fixed? We're facing this problem increasingly because of the popularity of Office365 resp. Exchange servers (see also #209). Our quick fix has been to revert your efforts to detect if SMTPUTF8 is really necessary and instead use it whenever the server supports it (#186). I know that this violates the following recommendation of RFC 6531:
A proper solution would probably include some form of pre-pass over all headers (see also section 3.6 of RFC 6531):
But even then VMime doesn't honour section 3.5 of RFC 6531:
|
Couldn't we fix this easily by calling ctx.setInternationalizedEmailSupport(true) only if SMTPUTF8 extension is available and we detected it should be used (ie. if needSMTPUTF8 == true)? |
I came back to this after several years because someone else has reported a similar problem, which was solved for now by setting their "use smtputf8" variable if both any address in the message has a non-ascii localpart and the next-hop server supports it. I became curious what the concrete problem was with setting ctx.setInternationalizedEmailSupport(true) based only on whether the addresses require it, ignoring any other header fields. I know it's against the rules in the RFC, but surely that wasn't the problem you observed? |
Your implementation of RFC 6532 may cause the sending of an email without activating SMTPUTF8 although it is mandatory according to RFC 6532:
When an SMTP server announces that it is capable of SMTPUTF8,
SMTPTransport::send
callsvmime/src/vmime/net/smtp/SMTPTransport.cpp
Line 428 in 182e8f5
Under certain circumstances, this keeps
word::generate
from outputting encoded words when it has to auto detect if encoding is neccessary:vmime/src/vmime/word.cpp
Line 460 in 182e8f5
For example, if you are in RFC 6532 mode and use a 'simple' subject header with umlauts,
wordEncoder::isEncodingNeeded
says not to encode:vmime/src/vmime/wordEncoder.cpp
Lines 245 to 284 in 182e8f5
Eventually, this leads to output of UTF-8 encoded text because of:
vmime/src/vmime/word.cpp
Lines 487 to 500 in 182e8f5
SMTPUTF8 must be activated in this situation. It is, however, activated only if
SMTPTransport::sendEnvelope
deems it necessary:vmime/src/vmime/net/smtp/SMTPTransport.cpp
Lines 210 to 223 in 182e8f5
Since
SMTPTransport::sendEnvelope
only considers email addresses and knows nothing of the yet to be generated message, we're in a mess!The text was updated successfully, but these errors were encountered: