Summary: doesn't escape leading dots
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Adam D. Ruppe <> 2012-08-11 
15:48:00 PDT ---
Consider the following:

void main() {
    auto smtp = SMTP("smtp://localhost");
    smtp.mailTo = ["<me>"];
    smtp.mailFrom = "<me>";
    smtp.message = "cool
does this have a bug?

I received:

does this have a bug?

Worse is if the message is:

does this have a bug?"

in which case it comes in as just


I've encountered this same bug in another smtp app too, it seems to be a tricky
one people miss, but it can happen in the real world especially if you are
sending html emails.

The fix isn't too hard though. When you're sending the data and encounter a
leading period in a line in the message, just prepend another period to it when
sending down the smtp connection.

"cool\n.\nmore" is sent as "cool\n..\nmore"

and then the recipient will get the right message.

Another thing to watch out for that seems to miss is a message
that starts with the word "From".

smtp.message = "From something

That first line gets cut off. The convention to fix this is to prepend the line
with the > character.

smtp is kinda weird :)

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to