with the python script below I try to fetch mails from gmail. Im my mailbox is only one unread message, but the script gives me the following output:
[b'330 332 335 337 339 340 341 ...... 450]
With an other provider an one unread Mail I get the output:
[b'13320]
And that's what I would expect.
Can someone help me, why does gmail print so many unseen mails? (No I haven't received about 80 mails in the last minutes.)
Thanks in advance!
Greetings Jan
import imaplib
from pprint import pprint
i=imaplib.IMAP4_SSL("imap.gmail.com")
i.login("myMailAdress@gmail.com", "myPasswd")
i.select("INBOX")
result, data=i.uid("SEARCH", "UNSEEN")
print(data)