Project

General

Profile

Actions

Bug #32082

closed

t3lib_mail_SwiftMailerAdapter::parseAddresses fail

Added by Thomas Pilgaard Carlsen over 12 years ago. Updated about 12 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-11-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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 <>".

It looks like t3lib_mail_SwiftMailerAdapter assumes that the From header contains only a valid email address.

Actions #1

Updated by Thomas Pilgaard Carlsen over 12 years ago

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 <>".

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.

Actions #2

Updated by Markus Klein over 12 years ago

Hi Thomas,
are you setting the From header with the $additionalHeaders parameter?

And shouldn't it be "Mr. Rogers" <>?

Actions #3

Updated by Jigal van Hemert over 12 years ago

  • 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 <> ) 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.

Actions

Also available in: Atom PDF