Project

General

Profile

Actions

Feature #93774

open

Check if default sendmail command contains "-i" option to prevent the "double dot problem"

Added by Jan Kornblum over 3 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Reports
Target version:
-
Start date:
2021-03-18
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.4
Tags:
sendmail, symfony, mail, double, dot, problem
Complexity:
Sprint Focus:

Description

Sending e-mail with line longer than 76 characters where dot is present as a 76th character produces duplicated dot while using Sendmail transport in -t mode.

There are some resources related to swiftmailer (below), but it also affects symfony/mail because the behaviour is caused by sendmail itself.

As mentioned in the swiftmailer inline documentation, it is highly recommended to use -i together with -t. So could (should) this be the new default for the TYPO3 core?

https://github.com/swiftmailer/swiftmailer/issues/1058
https://github.com/swiftmailer/swiftmailer/issues/72
https://github.com/swiftmailer/swiftmailer/blob/master/lib/classes/Swift/Transport/SendmailTransport.php#L54

Actions #1

Updated by Jan Kornblum over 3 years ago

To test, simply send a mail using the mail api where the 76th chacacter is a "dot":

/** @var MailMessage $mail */
$mail = GeneralUtility::makeInstance(MailMessage::class);
$mail->to(new Address('info@domain.tld'));
$mail->from(new Address('info@domain.tld'));
$mail->subject('Test');
$mail->html('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx12345.xxx');
$mail->send();

In the resulting mail, the "dot" has been replaced by a double dot:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx12345..xxx

This also occures, when the first letter of a line is a "dot":

$mail->html('.xxx');

This results in:

..xxx

In most environments this will be noticed only accidentally (if at all), but it happens. And especially when using the mail api intensively (e.g. for sending newsletters to lots of recipients), this can cause unpleasant results (dead links or invalid css classes).

It shouldn't be an integrators or developers part so set the sendmail option "-i" manually per instance (most won't do because they don't know why). It should be default.

Actions #2

Updated by Jan Kornblum over 3 years ago

It seems that TYPO3 retrieves the default sendmail command from PHP (php.ini). In my case (a fresh 10 LTS installation on mittwald) it is set like "sendmail_path = /usr/sbin/sendmail -t"). Should the core automatically extend it with "-i" if missing, despite? Or is this only a "mittwald" issue?

Actions #3

Updated by Jan Kornblum over 3 years ago

  • Tracker changed from Bug to Feature
  • TYPO3 Version deleted (10)
Actions #4

Updated by Andreas Kießling almost 3 years ago

I can't remember having had this problem on any other hosting than Mittwald. Maybe a check in the Reports module would be enough if sendmail is the configured transport.
When testing a clients bug report locally for "wrong urls with double dots" and you use something like ddev with mailhog you will never find the source of the problem :/

Actions #5

Updated by Jan Kornblum almost 3 years ago

  • Subject changed from Modify default sendmail command by adding "-i" option to prevent the "double dot problem" to Check if default sendmail command contains "-i" option to prevent the "double dot problem"
  • Category changed from Mailer API to Reports

Yes, it is definitly a mittwald (not TYPO3 core) problem. Already told them to change their default, they plan to do so. Nevertheless an additional check in "reports" module might really be helpful for certain "exotic" hostings ;) I've renamed this issue.

Actions

Also available in: Atom PDF