By using the search
query, I am able to get the ids of the all the emails. Now I want to download the attachments from those email. How can I implement that? Any advice would be appreciated, stuck here for a day!
EDIT:
This is the search
query:
m = imaplib.IMAP4_SSL('imap.gmail.com')
m.login(username, password)
m.select('inbox')
resp, data = m.uid('search', None, 'X-GM-RAW', 'has:attachment filename:xls')
emailids = data[0].split()