diff --git a/serpent/dataio.py b/serpent/dataio.py index b809dec..64e50a4 100644 --- a/serpent/dataio.py +++ b/serpent/dataio.py @@ -61,15 +61,18 @@ class SmtpFileStore(object): class MailDirStore(object): def __init__(self): from serpent.imap import mailbox + from mailbox import MaildirMessage self.mbox = mailbox + self.mbox.MaildirMessage = MaildirMessage def deliver(self, user, message): mdir = os.path.join(conf.app_dir, conf.maildir_user_path % user) if not os.path.exists(mdir): os.makedirs(mdir) inbox = os.path.join(mdir, 'INBOX') - mailbox = self.mbox.IMAPMailbox(inbox) + mailbox = self.mbox.ExtendedMaildir(inbox) + msg = self.mbox.MaildirMessage(message) try: - mailbox.addMessage(message, [IMAP_FLAGS['RECENT']]) + mailbox.add(msg, []) return True except: raise diff --git a/serpent/imap/mailbox.py b/serpent/imap/mailbox.py index be87ad3..8c9a542 100644 --- a/serpent/imap/mailbox.py +++ b/serpent/imap/mailbox.py @@ -1,4 +1,4 @@ -from mailbox import Maildir +from mailbox import Maildir, MaildirMessage import os class ExtendedMaildir(Maildir):