From b0340a0a8e58b2a3608fd04f1dbd79d260f81cbb Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 23 Apr 2012 22:23:42 +0200 Subject: remove custom passphrase cb, eliminate code duplication --- alot/account.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'alot/account.py') diff --git a/alot/account.py b/alot/account.py index a480e096..7549a705 100644 --- a/alot/account.py +++ b/alot/account.py @@ -5,8 +5,6 @@ import email import os import glob import shlex -from email.generator import Generator -from cStringIO import StringIO from alot.helper import call_cmd_async import alot.crypto as crypto @@ -166,14 +164,7 @@ class SendmailAccount(Account): logging.error(failure.value.stderr) raise SendingMailFailed(errmsg) - # Converting inner_msg to text with as_string() mangles lines - # beginning with "From", therefore we do it the hard way. - fp = StringIO() - g = Generator(fp, mangle_from_=False) - g.flatten(mail) - mailtext = crypto.RFC3156_canonicalize(fp.getvalue()) - - d = call_cmd_async(cmdlist, stdin=mailtext) + d = call_cmd_async(cmdlist, stdin=crypto.email_as_string(mail)) d.addCallback(cb) d.addErrback(errb) return d -- cgit v1.2.3