summaryrefslogtreecommitdiff
path: root/alot/account.py
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2012-04-23 22:23:42 +0200
committerMichael Stapelberg <michael@stapelberg.de>2012-04-23 22:23:42 +0200
commitb0340a0a8e58b2a3608fd04f1dbd79d260f81cbb (patch)
treecf802f53f1dc0834af7c4890e52ade5e14710de7 /alot/account.py
parent40756e734ae4ec14d0a9705910b0d6385517d27f (diff)
remove custom passphrase cb, eliminate code duplication
Diffstat (limited to 'alot/account.py')
-rw-r--r--alot/account.py11
1 files changed, 1 insertions, 10 deletions
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