fix(email): don't try to parse flags that seem to be invalid
Sometimes we get invalid flags from `imap.uid()`, like `[b'System Error (Failure)']`
This leads to the flag getting parsed as 83 (`ord('S')`)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
d0c314090c
commit
d285dd5cbf
1 changed files with 1 additions and 1 deletions
|
|
@ -283,7 +283,7 @@ class EmailServer:
|
|||
|
||||
def get_email_seen_status(self, uid, flag_string):
|
||||
"""parse the email FLAGS response"""
|
||||
if not flag_string:
|
||||
if not flag_string or not isinstance(flag_string, str | bytes):
|
||||
return None
|
||||
|
||||
flags = []
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue