February 17th, 2004, 11:52 AM
Join Date: Oct 2003
Time spent in forums: 12 h 27 m 38 sec
Reputation Power: 11
imaplib - retrieving and deleting files
I am writing a piece of code that retrieves emails from a server and is processing them accordingly (testing for spam). To add some additional functionality, I wish to delete emails from the server (in my case 'moppsy.comp.glam.ac.uk') once they have been read.
Does anyone have any knowledge or experince of doing this?
The function in which I connect to the server and retrieve the emails is below.
m = imaplib.IMAP4('moppsy.comp.glam.ac.uk')
typ, data = m.search(None, 'ALL')
for num in string.split(data):
print "Email Number:", num
typ, data = m.fetch(num, '(RFC822)')
Edit: Added tags.
Last edited by netytan : February 17th, 2004 at 01:29 PM.