def getMsg(self, id=None): #returns the body of the given message id if id is not None: m = mbox_email(self.getMboxMsg(id)) if m.getMessageID(): return (m.getFrom(), m.getTo(), m.getCC(), m.getSubject(), m.getDateTime(), \ m.getContent(), m.getAttachments())
def download_html(self, id, name, REQUEST=None, RESPONSE=None): """ """ id = self.urlUnquote(id) name = self.toUnicode(self.urlUnquote(name)) m = mbox_email(self.getMboxMsg(id)) data = m.getAttachment(name) self.REQUEST.RESPONSE.setHeader('Content-Disposition', 'attachment;filename=%s' % self.quote_attachment(name)) return File(name, '', data).__of__(self)
def getMsg(self, id=None): #returns the body of the given message id r = None if id is not None: imap_client_ob = self.create_imap_client() m = mbox_email(self.getMboxMsg(id)) if m.getMessageID(): r = (m.getFrom(), m.getTo(), m.getCC(), m.getSubjectEx(), m.getDateTime(), \ m.getContentEx(), m.getAttachments()) self.kill_imap_client(imap_client_ob) return r
def _getOb(self, id, default=_marker): if id.find('+++') != -1: info = id.split('+++') msg = info[0] att = info[1] if msg is not None: m = mbox_email(self.getMboxMsg(msg)) data = m.getAttachment(att) self.REQUEST.RESPONSE.setHeader('Content-Disposition', 'attachment;filename=%s' % self.quote_attachment(att)) return File(att, '', data).__of__(self) else: return None else: return getattr(self, id)