[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: Newlines in mimelib Assembling
From:       Carsten Burghardt <cb () magic-shop ! de>
Date:       2003-07-11 20:40:26
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Friday 11 July 2003 14:25, Marc Mutz wrote:
> On Friday 11 July 2003 13:23, Carsten Burghardt wrote:
> <snip>
>
> > My question is: do we really need these newlines?
> > I wonder if this might be a parsing bug as it doesn´t seem correct to
> > add newlines between parts if you have correctly parsed them.
>
> <snip>
>
> The CRLF immediately preceding a boundary is part of the boundary, ie.
> if boundary="foo", then the real boundary string that separates the
> body part content from the following body part's header is
>   \r\n--foo\r\n
> If mimelib adds _that_ \r\n, it's correct and the IMAP kioslave may be
> the culprit. If, OTOH, mimeolib adds the \r\n as part of the body
> part's content, then ditch it.

The part that is causing trouble is in DwEntity::Assemble. If I comment out 
the DW_EOL everything is ok but I wonder what will break as a result of this.

#if defined(DW_EOL_CRLF)
    if (len>=3 && (mString[len-1]!='\n' || mString[len-3]!='\n'))
#else
    if (len>=2 && (mString[len-1]!='\n' || mString[len-2]!='\n'))
#endif
    {
        if ( (mString[len-1] == '\n') &&
             mHeaders->HasContentType() &&
             (mHeaders->ContentType().Type()    == DwMime::kTypeMultipart) )
        {
            /* this is the case when we should not add an DW_EOL since
               another newline is already added by DwBody::Assemble()
               right before a boundary string.
               Why is this bad for multipart-mixed? Well, multipart-
               mixed can be part of a multipart-signed and an additional
               empty line makes the mail invalid for a verification
               (the signature was computed based on the same content,
               but with a single newline).
            */
        }
        else
            mString += DW_EOL;
    }


[Attachment #5 (application/pgp-signature)]

_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic