swiftmailer/swiftmailer — Issue #131: SMTP transport of periods is not RFC2821 compliance - periods disappear
Author: CraigMason
Created: 2011-11-11 16:39:01+00:00
State: open

This is a result of d03b11d57c906f6b2b79cebf130b5283590a6e37 in response to #99.

If the message body contains the sequence `\r\n.` the contents will be buffered. Unfortunately, the `$this->_buffer->flushBuffers();` is not executed until *after* the filters are reset to `$this->_buffer->setWriteTranslations(array());`

This means that any periods that exist at the start of a line, after encoding, will not be escaped as `..`. This breaks RFC2821 compliance and causes problems with numerous servers.

Thus, there is a 1 in 78 chance that any periods inside of a message body will disappear - particularly problematic with URLs!

From: http://tools.ietf.org/html/rfc2821#section-4.5.2

> When a line of mail text is received by the SMTP server, it checks
> the line. If the line is composed of a single period, it is
> treated as the end of mail indicator. If the first character is a
> period and there are other characters on the line, the first
> character is deleted.