Open sfnelson opened 10 years ago
This appears to be a limitation in JavaMail's InternetAddress
parser. 1.5.0-b1
behaves the same way.
postal.message> (.getAddress (InternetAddress. "pépé@example.com" "pépé"))
"pépé@example.com"
postal.message> (.getPersonal (InternetAddress. "Pépé <pépé@example.com>"))
AddressException Local address contains control or whitespace javax.mail.internet.InternetAddress.checkAddress (InternetAddress.java:1213)
Bill Shannon has responded to this issue and thinks RFC6531 support in JavaMail would be premature anyway because not many servers yet support it. That was almost a year ago though.
We're encountering this issue, but it looks like there's been some recent movement in JavaMail and times have indeed changed - JavaMail 1.6.0 (in RC now, slated for a summer 2017 release) now supports RFC 653[0-2]: https://github.com/javaee/javamail/issues/93#issuecomment-298527783
I'm not familiar enough with postal
to submit a PR today (and it may not be workable to depend on a release candidate of JavaMail), but let me know if it would help you out to create a PR for this.
Thank you!
These cases work now with Jakarta Mail (née JavaMail) 1.6.5:
postal.message> (.getPersonal (InternetAddress. "Pépé <pépé@example.com>"))
"Pépé"
postal.message> (make-address "tést@example.com" "Tést" "utf-8")
#object[javax.mail.internet.InternetAddress 0x353d19a4 "=?utf-8?Q?T=C3=A9st?= <tést@example.com>"]
postal.message> (make-address "tést@example.com" "utf-8")
#object[javax.mail.internet.InternetAddress 0x1a8ff709 "tést@example.com"]
postal.message> (make-address "Tést <test@example.com>" "utf-8")
#object[javax.mail.internet.InternetAddress 0x3671fd8a "=?utf-8?Q?T=C3=A9st?= <test@example.com>"]
Think we can close it?
RFC6531 email addresses still don't work in postal, #27 only addressed sender names and not email addresses.
The three argument version of this code is not called by any postal code afaict, and the two argument version returns nil when given non-ascii characters as input, e.g.