def save_draft(self, mail):
     mail = self.mailset.add_draft(Mail.from_json(mail))
     return mail.ident
 def update_draft(self, mail):
     mail = Mail.from_json(mail)
     self.mailset.update(mail)
     return mail.ident
 def send(self, mail):
     mail = Mail.from_json(mail)
     self.mailset.update(mail)
     self.tagsset.increment_tag_total_count('sent')
     self.tagsset.decrement_tag_total_count('drafts')
     return mail.ident