summaryrefslogtreecommitdiff
path: root/alot/account.py
diff options
context:
space:
mode:
authorpazz <patricktotzke@gmail.com>2011-06-22 23:25:29 +0100
committerpazz <patricktotzke@gmail.com>2011-06-22 23:25:29 +0100
commitc2dad59bba232b396f487d9ba33fe77a12790f7c (patch)
treea238a0bb5fa961f1d2fdce92db37a5083c284e82 /alot/account.py
parentb64c9809eead156ac154951171808106cfe509ae (diff)
added accounts and sender, sendCmd works
Diffstat (limited to 'alot/account.py')
-rw-r--r--alot/account.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/alot/account.py b/alot/account.py
new file mode 100644
index 00000000..b00cee57
--- /dev/null
+++ b/alot/account.py
@@ -0,0 +1,46 @@
+"""
+This file is part of alot.
+
+Alot is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation, either version 3 of the License, or (at your
+option) any later version.
+
+Alot is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with notmuch. If not, see <http://www.gnu.org/licenses/>.
+
+Copyright (C) 2011 Patrick Totzke <patricktotzke@gmail.com>
+"""
+
+import mailbox
+
+from send import SendmailSender
+
+
+class Account:
+ def __init__(self, address, realname=None,
+ gpg_key=None,
+ signature=None,
+ sender_type='sendmail',
+ sendmail_command='sendmail',
+ sent_mailbox=None):
+ self.address = address
+ self.realname = realname
+ self.gpg_key = gpg_key
+ self.signature = signature
+ self.sender_type = sender_type
+
+ if sent_mailbox:
+ #parse mailbox url
+ self.mailbox = mailbox.Maildir(sent_mailbox)
+ else:
+ self.mailbox = sent_mailbox
+
+ if self.sender_type == 'sendmail':
+ self.sender = SendmailSender(sendmail_command,
+ mailbox=self.mailbox)