I'm trying to mark email as unseen on Gmail server.
I'm using this command:
res, data = mailbox.uid('STORE', uid, '-FLAGS', '(\Seen)')
Everything goes OK but when I check it using web browser it's still marked as seen. When I check flags here's what I got:
b'46 (FLAGS (-FLAGS \\Seen))'
I've seen multiple questions on this issue but none of the proposed solutions work.
Just to mention that I'm appending this email using:
mailbox.append(db_email.folder, "-FLAGS \Seen", time.mktime(db_email.date.timetuple()), mail.as_bytes())
But the flag parameter -FLAGS \Seen
does not have any effect since it's the same when I don't pass flag argument.
Also, I've double-checked uid
for given mail folder and it matches to appropriate email.