Fetch an email with imaplib but do not mark it as SEEN

前端 未结 4 585
慢半拍i
慢半拍i 2020-11-28 09:59

I want to parse some emails from a user \'s inbox but when I do:

typ, msg_data = imap_conn.fetch(uid, \'(RFC822)\')

It marks the email as S

4条回答
  •  醉话见心
    2020-11-28 10:24

    You can use (RFC822.PEEK) as the "message-parts" argument, according to RFC 1730 (I have not verified which servers actually implement that correctly, but it doesn't seem hard for them to).

提交回复
热议问题