def reply_to_email(self): reply_to = self.reply_to email = reply_to if reply_to: gre = Re() gre.match(r'(?:.*) <(.*)>', reply_to) if gre.last_match: email = gre.last_match.group(1) else: pass return email
def sender_email(self): sender = self.sender email = sender if sender: gre = Re() gre.match(r'(?:.*) <(.*)>', sender) if gre.last_match: email = gre.last_match.group(1) else: pass return email
def reply_to_name(self): reply_to = self.reply_to name = reply_to if reply_to: gre = Re() gre.match(r'(.*) <(.*)>', reply_to) if gre.last_match: name = gre.last_match.group(1) # strip off quotes around reply_to name gre.match(r'"(.*)"', name) if gre.last_match: name = gre.last_match.group(1) else: pass return name
def sender_name(self): sender = self.sender name = sender if sender: gre = Re() gre.match(r'(.*) <(.*)>', sender) if gre.last_match: name = gre.last_match.group(1) # strip off quotes around sender name gre.match(r'"(.*)"', name) if gre.last_match: name = gre.last_match.group(1) else: pass return name