Menu

#63 Dot character is lost in body.

open
nobody
None
5
2005-04-28
2005-04-28
Bobozo
No

When email body is encoded in quoted-printable format,
if a dot character (".") exists in email html body, where
quoted-printable formatter inserts a new line character
(ex: around 76th character of email body), the dot
character is deleted.

How to reproduce :

MailMessage msg = new MailMessage
("test@nowhere.com","test@nowhere.com");
msg.Body="123456789 123456789 123456789
123456789 123456789 123456789 123456789 here.dot";
Smtp smtp = new Smtp("127.0.0.1",25);
smtp.SendMail(msg);

The body of the received email :

123456789 123456789 123456789 123456789
123456789 123456789 123456789 heredot

(NOT "here.dot" !!!)

Discussion

  • Tobias Hertkorn

    Tobias Hertkorn - 2005-05-17

    Logged In: YES
    user_id=156255

    I came across the same problem. Here is the solution:

    In src/MailEncoder.cs:

    Change around line 237:
    ---
    if (breakAt<70) breakAt = 74;
    sb.Append(cLine.Substring(0, breakAt) + "=\r\n");
    currLine = new StringBuilder(cLine.Substring(breakAt));
    ---

    TO

    ---
    if (breakAt<70) breakAt = 74;
    sb.Append(cLine.Substring(0, breakAt) + "=\r\n");
    if (cLine.Substring(breakAt).StartsWith("."))
    {
    currLine = new StringBuilder("=2E");
    currLine.Append(cLine.Substring(breakAt + 1));
    }
    else
    {
    currLine = new StringBuilder(cLine.Substring(breakAt));
    }

    That should take care of that bug.

    Cheers,
    Tobi

     
  • Snoopy-99

    Snoopy-99 - 2005-06-30

    Logged In: YES
    user_id=1229676

    I too have come across this. I add the following at two
    places, the first, just before comment // RFC 822 linebreak =
    CRLF about line 243 of MailEncoder.cs and the 2nd just
    below at the next comment // add last line

    // RFC 821 4.5.2 Transparancy... line starts with . make ..
    if (currLine.ToString().StartsWith("."))
    sb.Append(".");

     
  • GWSyZyGy

    GWSyZyGy - 2005-06-30

    Logged In: YES
    user_id=1068867

    There is a related bug report: [ 1178622 ] Premature "End of
    Message"

     
  • Nobody/Anonymous

    Logged In: NO

    Yes, we have found the same problem. When including an href
    link with an ip address in an html e-mail, one of the
    periods almost always disappears.

     

Log in to post a comment.