diff options
author | pazz <patricktotzke@gmail.com> | 2011-07-03 17:32:05 +0100 |
---|---|---|
committer | pazz <patricktotzke@gmail.com> | 2011-07-03 17:32:05 +0100 |
commit | 5f431ba9a1e8d62968da2a46f2d23430779393fc (patch) | |
tree | 2b3a1e9cb1836d06bff71fa5398f82cc06418a7e /alot/account.py | |
parent | 6c0083358201c663a1ef15d94d8f3b440d029eee (diff) |
accept multiple formats for send_mailbox
Diffstat (limited to 'alot/account.py')
-rw-r--r-- | alot/account.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/alot/account.py b/alot/account.py index b00cee57..021d7c05 100644 --- a/alot/account.py +++ b/alot/account.py @@ -18,6 +18,7 @@ Copyright (C) 2011 Patrick Totzke <patricktotzke@gmail.com> """ import mailbox +from urlparse import urlparse from send import SendmailSender @@ -35,11 +36,19 @@ class Account: self.signature = signature self.sender_type = sender_type + self.mailbox = None if sent_mailbox: - #parse mailbox url - self.mailbox = mailbox.Maildir(sent_mailbox) - else: - self.mailbox = sent_mailbox + mburl=urlparse(sent_mailbox) + if mburl.scheme=='mbox': + self.mailbox = mailbox.mbox(mburl.path) + elif mburl.scheme=='maildir': + self.mailbox = mailbox.Maildir(mburl.path) + elif mburl.scheme=='mh': + self.mailbox = mailbox.MH(mburl.path) + elif mburl.scheme=='babyl': + self.mailbox = mailbox.Babyl(mburl.path) + elif mburl.scheme=='mmdf': + self.mailbox = mailbox.MMDF(mburl.path) if self.sender_type == 'sendmail': self.sender = SendmailSender(sendmail_command, |