Add getter for Message-ID
This commit is contained in:
parent
f13ecc5aca
commit
0878e830e4
1 changed files with 5 additions and 0 deletions
|
@ -65,6 +65,11 @@ class Message():
|
||||||
def header(self, key: str):
|
def header(self, key: str):
|
||||||
return self.headers.get(key.lower())
|
return self.headers.get(key.lower())
|
||||||
|
|
||||||
|
def id(self) -> str:
|
||||||
|
match = self.RE_MESSAGE_ID.match(self.header('Message-ID'))
|
||||||
|
|
||||||
|
return match[1]
|
||||||
|
|
||||||
def date(self):
|
def date(self):
|
||||||
try:
|
try:
|
||||||
return search_dates(self.headers['date'])[0][1]
|
return search_dates(self.headers['date'])[0][1]
|
||||||
|
|
Loading…
Add table
Reference in a new issue