fuel / email

Fuel PHP Framework - Fuel v1.x Email library
60 stars 38 forks source link

Doubling dots breakes mail css styles #66

Closed ppatrik closed 8 years ago

ppatrik commented 8 years ago

is there any reason for this ? preg_replace('/^./m', '..$1', $message['body'])

because it makes me this at html mails

<style> .some {background: black}
..other {color: white} </style>
WanWizard commented 8 years ago

You'd have to ask Frank, it was part of his initial commit on July 20th 2011: https://github.com/fuel/email/commit/8af85da51095b1c97f8b86feca2d735d5e24e562#diff-817004857bda061af594bba1e93ce641R63

I'd have to see what it exactly does there, I assume it has a reason for it being there...

WanWizard commented 8 years ago

Already found it. Dot-stuffing is part of the RFC, and the client should remove the double-dot when the email is received: http://stackoverflow.com/questions/8971703/smtp-dot-stuffing-who-does-it-and-who-removes-it. See also https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol under the SMTP example.

So what is the receiving end of this email that you send, because that seems to do it wrong?

ppatrik commented 8 years ago

I tried multiple mail clients like thunderbird, roundcube, outlook but any of them doesn't removed double-dot. Is dot-stuffing part of mail boundaries too? isnt it only for plain texts? When line with dot is ending line we should do this instead

if($line === '.') {
    $line  = '..';
}