diff --git a/redbox/models/message.py b/redbox/models/message.py index 030ebd4..73615d3 100644 --- a/redbox/models/message.py +++ b/redbox/models/message.py @@ -81,7 +81,10 @@ def subject(self) -> str: def date(self) -> Dict[str, str]: headers = {k.lower(): v for k, v in self.headers.items()} date = headers['date'] - return datetime.datetime.strptime(date, "%a, %d %b %Y %H:%M:%S %z") + try: + return datetime.datetime.strptime(date, "%a, %d %b %Y %H:%M:%S %z") + except ValueError: + return datetime.datetime.strptime(date, "%d %b %Y %H:%M:%S %z") def read(self): "Read the message (set flag '\Seen')"