Bug #32082
closed
t3lib_mail_SwiftMailerAdapter::parseAddresses fail
Added by Thomas Pilgaard Carlsen almost 13 years ago.
Updated over 12 years ago.
Description
It seems that validation fails if you use t3lib_utility_Mail::mail and set a "From" header with a value in the form "Mister Rogers <rogers@foo.com>".
It looks like t3lib_mail_SwiftMailerAdapter assumes that the From header contains only a valid email address.
Thomas Pilgaard Carlsen wrote:
It seems that validation fails if you use t3lib_utility_Mail::mail and set a "From" header with a value in the form "Mister Rogers <rogers@foo.com>".
It looks like t3lib_mail_SwiftMailerAdapter assumes that the From header contains only a valid email address.
Update: It looks like this only fails when From name contains a "." character, eg. "Mr. Rogers" AND not in the example provided. Sorry for the confusion.
Hi Thomas,
are you setting the From header with the $additionalHeaders parameter?
And shouldn't it be "Mr. Rogers" <rogers@foo.com>?
- Status changed from New to Rejected
The validation is to make sure that there are well formed recipients and senders in the resulting message.
The SwiftMailer Adapter is only meant to redirect mails sent with the old mail API to the new API. Because the old mail API expected the calling code to form its mail headers the SwiftMailer Adapter has to parse the complete mail message and build a new one with the new API. We included support for a wide range of mail headers and body formats. It isn't perfect and can't parse all types of mail messages (it doesn't support nested body parts for example).
It does expect the mail headers to be valid. If you try to use an invalid header (e.g. From: Mr. Rogers <rogers@foo.com> ) the parser will not fix this for you.
If you insist on using invalid mail headers you can disable the SwiftMailer adapter in the Install Tool and use the old mail API. You will then lose the features of the new API (for example the possibility to send mail through SMTP) with extensions which use the old mail API.
Also available in: Atom
PDF