Bug 313478

Summary: Kmail adds newlines to inline-gpg-signed messages
Product: kmail2 Reporter: quazgar <quazgar>
Component: cryptoAssignee: kdepim bugs <kdepim-bugs>
Severity: normal    
Priority: NOR    
Version: 4.9.3   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.2

Description quazgar 2013-01-19 00:59:45 UTC
When signing messages inline (no OpenPGP/MIME attachment), line endings in the message are mixed between \n (Unix line ending) and \r\n (DOS line ending). This equivalent to the output produced on the command line by 

  gpg --clearsign -a > test_output

The \r\n lines however do not arrive intact after sending: They seem to be converted to \n\n (two newlines), which breaks the signature. The sent-messages folder shows still a correct signature (with \r\n) but in the inbox the signature is shown as invalid (since all newlines from the original message have effectively doubled to \n\n).

This bug happens with several mail servers, it does not happen when sending the content of the above mentioned file test_output manually with e.g. Python's SMTP lib via the same mail servers.

Reproducible: Always

Steps to Reproduce:
1. Compose a multiline message.
2. Sign as Inline PGP.
3. Send message.
Actual Results:  
Each newline is doubled, GPG signatures are invalid.

Expected Results:  
Should not change newlines.
Comment 1 Sandro Knauß 2013-03-24 21:28:43 UTC
Git commit 0b476b100d0afcd144b05b21ce856971862e6c20 by Sandro Knauß.
Committed on 21/03/2013 at 01:35.
Pushed by knauss into branch 'KDE/4.10'.

Fixing newline issue with mailcomposer

Newlines for PGP inline signed/enc+signed mails are wrongly handled.
Newlines are replaced by <CR><LF> before creating the signature. This is
not recommended for inline messages.
FIXED-IN: 4.10.2
REVIEW: 109634

M  +7    -5    messagecomposer/signencryptjob.cpp
M  +7    -9    messagecomposer/signjob.cpp