Bug #23955
closedfrom_name should be quoted (at least when it's an e-mail address)
0%
Description
I ran into this issue when the from address of e-mails sent by tx_powermail where rewritten by MS Exchange.
The from address name@domain.com appears as:
name@ [domain.com name@domain.com]
This problem only occured when sending to an Exchange server. Mailboxes behind a postfix or qmail server didn't suffer from this issue. At this point, your conclusion could be that it's an Echange issue but I think otherwise.
After a few debugging sessions I found out that this issue triggered by the 'From:' header being formatted like this:
name@domain.com <name@domain.com>
I've read the different RFC's about e-mail address formatting, as far as I was able to understand them.
In RFC terminology this is: display-name <addr-spec>
If you follow the rules, an e-mail address is not allowed as the display-name because of the '@' sign. In that case the display-name should be quoted. It looks like MS Exchange adheres more to the RFC then other MTA's.
The most simple solution is to always quote the display-name and change this line:
$this->add_header('From: '.$this->from_name.' <'.$this->from_email.'>');
to
$this->add_header('From: "'.$this->from_name.'" <'.$this->from_email.'>');
Perhaps an extra check should be added to only do this when it's required by the RFC.
In this particular case the from_name was set to an e-mail address by the tx_powermail extension. Perhaps the problem should be solved from that end but I think the community should decide on that.
(issue imported from #M16266)
Updated by Joost van Beurden about 14 years ago
After giving it a little bit more thought, I guess this should be fixed in the tx_powermail extension. What do you think?
This would be the fix in typo3conf/ext/powermail/pi1/class.tx_powermail_submit.php:
- $this->htmlMail->from_name = $this->maildata['sendername']; // sender email name
+ $this->htmlMail->from_name = '"'.$this->maildata['sendername'].'"'; // sender email name
Updated by Alexander Opitz almost 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0) - TYPO3 Version set to 4.4
- Is Regression set to No
Hi,
as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Markus Klein almost 11 years ago
- Status changed from Needs Feedback to Closed
Closing as duplicate of #22064