Closed ARitz-Cracker closed 4 years ago
Not sure if that covers all cases but it's a good workaround for now. Thanks for the PR.
v0.3.3
Thank you for accepting the PR!
This should work in most cases, as the leftmost part of the email address before the @
is only useful information to the destination server. If the destination server doesn't support unicode users, then it definitely won't have a unicode-named mailbox. However, I found that the domain part should always be punycoded. I use the punycode package's toASCII function for that Some mail server software, even if they're utf8 aware, won't escape the domain themselves before looking up the domain.
(E-mail is such a pain)
If the sender or receiver has utf8 characters in their address, then the
MAIL
command must end withSMTPUTF8
. (if the server supports it) Otherwise, the server will complain when it receives 8 bit data.Since this library has no knowledge of the recipients when it sends the
MAIL
command (which is fair since this is a "low level" library anyway) we have no way of knowing whether or not we even need to enableSMTPUTF8
extensions. So that responsibility can fall on the people who end up using this thing.