- Joined
- Aug 16, 2022
- Messages
- 10
- Reaction score
- 0
Hello,
Want to search for [email protected] domain, move those emails to folder called DUMP, then delete contents of DUMP.
Unfortunately I can't figure out how to do what I need above!
Any guidance is appreciated!!
My code below:
How can I modify above code to do what I need, please?
Want to search for [email protected] domain, move those emails to folder called DUMP, then delete contents of DUMP.
Unfortunately I can't figure out how to do what I need above!
Any guidance is appreciated!!
My code below:
Python:
import imaplib
box = imaplib.IMAP4_SSL('imap.mail.yahoo.com', 993)
box.login("[email protected]","xxxxxxxx")
box.select('DUMP')
typ, data = box.search(None, 'from','name@*.*')
for num in data[0].split():
box.store(num, '+FLAGS', '\\Deleted')
box.expunge()
box.close()
box.logout()
How can I modify above code to do what I need, please?
Last edited: