Bug 174942 - Forwarding mails containing non-ascii characters using a filter can produce garbage
Summary: Forwarding mails containing non-ascii characters using a filter can produce g...
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Unmaintained
Component: filtering (show other bugs)
Version: 1.11.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2008-11-12 12:40 UTC by Dime2
Modified: 2009-03-18 10:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Original mail (1000 bytes, text/plain)
2009-03-15 13:12 UTC, Michael Leupold
Details
Generated forward mail (872 bytes, text/plain)
2009-03-15 13:13 UTC, Michael Leupold
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dime2 2008-11-12 12:40:51 UTC
Version:           1.9.9 (using KDE 3.5.9)
OS:                Linux
Installed from:    Fedora RPMs

If I received the 8bit message and try to formad it manually (inline forwarding), it is working the best.
But if I use filters for forwarding, kmail sumit the message as 7bin only in 99% cases
Plus, before beginning of the oroginal message it is added the garbage symbols. If message didn't have html then forwarding produced without content but with the carbage symbols only.
Comment 1 Michael Leupold 2009-03-15 13:08:57 UTC
I can reproduce this behaviour using the following instructions:
1. Add a new incoming mail filter.
2. Set it to forward messages to another account
3. Send yourself a mail that triggers this filter. Add non-ascii characters (eg. chinese, cyrillic, ...) and let KMail choose the encoding automatically.
4. Wait for the message to be sent and forwarded using the filter.

Result: The original message displays correctly. The forwarded message is displayed encoded. It actually looks as if the encoded mime-part was inlined without adding appropriate mime-headers (original message encoded using base64, forwarded mail is sent as 7bit).
Comment 2 Michael Leupold 2009-03-15 13:12:39 UTC
Created attachment 32132 [details]
Original mail

This is the original mail I sent.
(shadowed email addresses, message-id and removed part of the route)
Comment 3 Michael Leupold 2009-03-15 13:13:18 UTC
Created attachment 32133 [details]
Generated forward mail

This is the forward that was generated by the filter.
(shadowed email addresses, message-id and removed part of the route)
Comment 4 Thomas McGuire 2009-03-17 14:59:07 UTC
SVN commit 940441 by tmcguire:

Don't produce garbage when forwarding a mail with a filter.

For this, I had to remove the code duplication in KMFilterActionForward::process()
and use KMMessage::createForward() instead.

This uncovered a bug in createForward (content type boundary was not saved) and a
small bug in the template parser.

Also, I added a KMMessage::dump() function to help with debugging mimelib 
related troubles.

Not perfect yet, the way the template parser copies the message needs to be
improved, right now, when forwarding a signed message, the signed text gets
replaced with the template text, resulting in an invalid signature ...

BUG: 174942


 M  +11 -72    kmfilteraction.cpp  
 M  +44 -7     kmmessage.cpp  
 M  +22 -1     kmmessage.h  
 M  +1 -0      templateparser.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=940441
Comment 5 Thomas McGuire 2009-03-18 10:32:24 UTC
SVN commit 940772 by tmcguire:

Backport r940441 by tmcguire from trunk to the 4.2 branch:

Don't produce garbage when forwarding a mail with a filter.

For this, I had to remove the code duplication in KMFilterActionForward::process()
and use KMMessage::createForward() instead.

This uncovered a bug in createForward (content type boundary was not saved) and a
small bug in the template parser.

Also, I added a KMMessage::dump() function to help with debugging mimelib 
related troubles.

Not perfect yet, the way the template parser copies the message needs to be
improved, right now, when forwarding a signed message, the signed text gets
replaced with the template text, resulting in an invalid signature ...

CCBUG: 174942



 M  +11 -72    kmfilteraction.cpp  
 M  +44 -7     kmmessage.cpp  
 M  +22 -1     kmmessage.h  
 M  +1 -0      templateparser.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=940772