[Tutor] IMAP help to delete and copy messages
Jacob Abraham
jakieabraham@yahoo.com
Thu Jun 12 02:11:02 2003
IMAP help to delete and copy messages.
Dear tutor,
My program objective was to (read/print) a messege
copy it into another mail box and delete the messege
from the inbox. But the delete function deletes the
entire mail box and not a particular messege please
help.
Jacob Abraham
#This program has errors
import imaplib
M=imaplib.IMAP4('www.XXX.com',143)
M.login('NAME','PASSWOR')]]
T=M
T.create('temp')
T.select(mailbox='temp')
M.select()
typ, data=M.search(None, '(FROM "Jacob Abraham")')
for num in data[0].split():
typ,data=M.fetch(num,'(RFC822)')
print data[0]
print "Message %s \n %s\n"%(num,data[0][1])
a=data[0][1]
M.copy(num,'temp')
M.delete()
M.logout()
T.logout()
import sys
sys.exit()
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com