robotframework-imaplibrary
robotframework-imaplibrary copied to clipboard
New keyword to delete all messages
Please add new keyword to have possibility delete all messages in email
If you send a pull request with the implementation of the keyword i may merge and release it.
Sorry, I'll just put code here:
def delete_all_messages(self):
"""
Delete all received mails
"""
type, data = self.imap.search(None, 'ALL')
if not str(data) == "[None]":
for mail in data[0].split():
self.imap.store(mail, '+FLAGS', '\Deleted')
self.imap.expunge()
else:
pass