Store Message-ID with <> brackets

This commit is contained in:
XANTRONIX Development 2024-11-09 21:43:09 -05:00
parent 86a09b637f
commit 4a7808de48

View file

@ -48,7 +48,6 @@ class Message(DatabaseTable):
) )
RE_HEADER = re.compile(r'^([A-Za-z0-9\-]+): (.*)$') RE_HEADER = re.compile(r'^([A-Za-z0-9\-]+): (.*)$')
RE_MESSAGE_ID = re.compile(r'^<([^<>]+)>$')
def __init__(self): def __init__(self):
self.id = None self.id = None
@ -110,9 +109,8 @@ class Message(DatabaseTable):
return self.headers.get(key.lower()) return self.headers.get(key.lower())
def unique_id(self) -> str: def unique_id(self) -> str:
match = self.RE_MESSAGE_ID.match(self.header('Message-ID')) return self.header('Message-ID')
return match[1]
def date(self): def date(self):
try: try: