summaryrefslogtreecommitdiff
path: root/alot/commands.py
diff options
context:
space:
mode:
authorpazz <patricktotzke@gmail.com>2011-07-18 23:11:53 +0100
committerpazz <patricktotzke@gmail.com>2011-07-18 23:11:53 +0100
commitcaaf9ac7e3c817dc37c3b67042d739e5ac27a980 (patch)
tree9e5d52dd5ab0b6f1dacd89e82d1074856323f72f /alot/commands.py
parent36766b30c87636ffb04ef817a5dea5a7db73240f (diff)
readded send command, fix misbehaviour of compose
Diffstat (limited to 'alot/commands.py')
-rw-r--r--alot/commands.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/alot/commands.py b/alot/commands.py
index 3d0654a5..4820e9f3 100644
--- a/alot/commands.py
+++ b/alot/commands.py
@@ -347,10 +347,11 @@ class SendMailCommand(Command):
Command.__init__(self, **kwargs)
def apply(self, ui):
- sname, saddr = helper.parse_addr(self.email.get('From'))
+ mail = ui.current_buffer.get_email()
+ sname, saddr = email.Utils.parseaddr(mail.get('From'))
account = get_account_by_address(saddr)
if account:
- success, reason = account.sender.send_mail(self.email)
+ success, reason = account.sender.send_mail(mail)
if success:
if self.envelope_buffer: # close the envelope
cmd = BufferCloseCommand(buffer=self.envelope_buffer)
@@ -363,9 +364,13 @@ class SendMailCommand(Command):
class ComposeCommand(Command):
- def __init__(self, email=None, headers={}, **kwargs):
- self.headers = headers
- self.mail = email
+ def __init__(self, mail=None, headers=None, **kwargs):
+ if headers:
+ self.headers = headers
+ else:
+ self.headers = {}
+ self.mail = mail
+ logging.debug(headers)
Command.__init__(self, **kwargs)
def apply(self, ui):