NativeMail+mail() double-escape dots at the beginning of a l
Posted: Fri Oct 10, 2008 12:13 pm
NativeMail in conjunction with mail() leads to doubled dots in the received mail.
I think NativeMail should not double dots in fixLE() because PHP's mail() function seems to escape dots at the beginning of a line again, thus in the end, I receive a mail with two dots where there should be only one. This is especially unfortunate if it happens within URLs that were wrapped by the encoding process, so I end up with links like http://www.example..com/
Our workaround was to use the Sendmail connection instead of NativeMail.
Are there any configuration options we could have changed instead?
Using:
* Swift version 3.3.2
* PHP 5.2.0-8+etch11 (Debian)
* Input is a simple HTML source
* Sample code:
I think NativeMail should not double dots in fixLE() because PHP's mail() function seems to escape dots at the beginning of a line again, thus in the end, I receive a mail with two dots where there should be only one. This is especially unfortunate if it happens within URLs that were wrapped by the encoding process, so I end up with links like http://www.example..com/
Our workaround was to use the Sendmail connection instead of NativeMail.
Are there any configuration options we could have changed instead?
Using:
* Swift version 3.3.2
* PHP 5.2.0-8+etch11 (Debian)
* Input is a simple HTML source
* Sample code:
Code: Select all
$mailTo = $arrParamsToSave['email'];
$mailFrom = new Swift_Address(
sfConfig::get('app_mail_registermailsender'),
sfConfig::get('app_mail_registermailsender_name')
);
try {
// Create the mailer and message object
$mailer = new Swift(new Swift_Connection_NativeMail());
$message = new Swift_Message($subject, $mailBody, 'text/html');
$mailer->send($message, $mailTo, $mailFrom);
$mailer->disconnect();
} catch (Exception $e) {
if($mailer instanceof Swift) {
$mailer->disconnect();
}
$this->logMessage("Failed to send mail.", 'err');
}