Gmail automatically put emails under three different tabs: Primary, Social, Promotions, when I try to read the latest email with the code below, it gets all emails ignoring the tabs. How do I get email under Primary tab only? Is there another folder name I should use?
M.select("INBOX")
v_start_date = (datetime.date.today() - datetime.timedelta(days_limit)).strftime("%d-%b-%Y")
v_result, v_mail = M.uid('search', None, '(SENTSINCE {date})'.format(date=v_start_date))
imaplib code sample: https://gist.github.com/robulouski/7441883
Gmail inbox screenshot: