diff options
author | Yann Rouillard <yann@pleiades.fr.eu.org> | 2013-12-06 10:13:36 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2014-08-02 17:29:33 +0200 |
commit | 6e1990f019fee1cf01af1c63e6f18607da672296 (patch) | |
tree | 885f8ac0a26bd0e0e53929d2f21412fd08ee256d /alot | |
parent | 8fa7d09caa0e5f3581b163ba388ed2e853861dc7 (diff) |
properly wrap a forwarded message in message/rfc822 part
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/thread.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 815af42e..04fadeeb 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -9,6 +9,7 @@ import argparse from twisted.internet.defer import inlineCallbacks import subprocess from email.Utils import getaddresses, parseaddr +from email.message import Message import mailcap from cStringIO import StringIO @@ -20,6 +21,7 @@ from alot.commands.globals import MoveCommand from alot.commands.globals import CommandCanceled from alot.commands.envelope import SendCommand from alot import completion +from alot import crypto from alot.db.utils import decode_header from alot.db.utils import encode_header from alot.db.utils import extract_headers @@ -310,9 +312,11 @@ class ForwardCommand(Command): else: # attach original mode # attach original msg - mail.set_type('message/rfc822') - mail['Content-Disposition'] = 'attachment' - envelope.attach(Attachment(mail)) + original_mail = Message() + original_mail.set_type('message/rfc822') + original_mail['Content-Disposition'] = 'attachment' + original_mail.set_payload(crypto.email_as_string(mail)) + envelope.attach(Attachment(original_mail)) # copy subject subject = decode_header(mail.get('Subject', '')) |