zsoro
zsoro

Reputation: 82

Reading \Seen, \Unseen flags using imaplib in Python

Is it possible to read e-mail flags Seen, Unseen and restore them as the were before reading e-mail using imaplib in Python? I couldn't find yet any information regarding reading these flags but there is plenty of examples setting Seen, Unseen etc. flags. I would appreciate if somebody would guide me to the right direction.

Upvotes: 1

Views: 1672

Answers (1)

zsoro
zsoro

Reputation: 82

A big thanks goes to @stovfl and @Max in comments. I successfully made my program work using imap_conn.fetch(uid, '(BODY.PEEK[HEADER])'). On the other side if somebody needs read-only access they can use imap_conn.select('Inbox', readonly=True)

Upvotes: 2

Related Questions