martinrusev / imbox

Python IMAP for Human beings
MIT License
1.18k stars 188 forks source link

Marking e-mails as not seen #241

Closed PWrzesinski closed 9 months ago

PWrzesinski commented 10 months ago

I think it would be useful to have a method for marking e-mails as not seen, so reversing the mark_seen method. I do need it in my project. Would it be something as simple as adding:

def mark_unseen(self, uid):
    logger.info("Delete \\Seen FLAG from UID {}".format(int(uid)))
    self.connection.uid('STORE', uid, '-FLAGS', '(\\Seen)')

inside Imbox.py? If so I'd be happy to make a PR.

PWrzesinski commented 10 months ago

Less of a priority, in the end I just did:

imbox.connection.uid('STORE', uid, '-FLAGS', '(\\Seen)')

in my code. Happy to either make a PR or close the issue.