def references(self): """ Retunrs message-ids referencing the message in accordance to jwz threading algo """ refs = list(MessageId.scan(self.headers.get('References', ''))) if not refs: reply = MessageId.from_string(self.headers.get('In-Reply-To', '')) if reply: refs.append(reply[0]) return refs
def references(self): """ Returns a list of message ids referencing the message in accordance to the Jamie Zawinski threading algorithm. See http://www.jwz.org/doc/threading.html for details. """ refs = list(MessageId.scan(self.headers.get('References', ''))) if not refs: reply = MessageId.from_string(self.headers.get('In-Reply-To', '')) if reply: refs.append(reply[0]) return refs
def message_id(self, value): if not MessageId.is_valid(value): raise ValueError("invalid message id format") self.headers['Message-Id'] = "<{0}>".format(value)
def message_id(self): return MessageId.from_string(self.headers.get('Message-Id', ''))
def message_id(self, value): if not MessageId.is_valid(value): raise ValueError('invalid message id format') self.headers['Message-Id'] = '<{0}>'.format(value)
def message_id(self): return MessageId.from_string(self.headers.get("Message-Id", ""))