Store Message-ID with <> brackets
This commit is contained in:
parent
86a09b637f
commit
4a7808de48
1 changed files with 2 additions and 4 deletions
|
@ -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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue