Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53020
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-08-26 16:34 -0700 |
| Message-ID | <c7b0fe9a-990f-403a-b39b-0f080f8571a6@googlegroups.com> (permalink) |
| Subject | Imaplib & Gmail - cannot move from inbox to custom folder (message remains in both) |
| From | rob@attoenterprises.com |
I am using Imaplib and connecting to a Gmail account. I am issuing commands to copy the email to a custom folder then issuing delete. After expunge message still remains in inbox and customer folder.
# COPY EMAIL TO FOLDER
copyStatus = m.copy(emailid, 'CIRIMPORTED')
print 'id of message copied is: %s status: %s' % (emailid,copyStatus)
# SET THE MESSAGE TO HAVE '\Deleted' FLAG (EXPUNGE WILL COMPLETE DELETE PROCESS)
storeStatus = m.store(emailid,"+FLAGS", r'(\Deleted)')
print 'id of message stored is: %s status: %s %s' % (emailid,storeStatus[0],storeStatus[1])
#print '******'
#DELETES ANY EMAIL MARKED \Deleted
m.expunge()
m.close()
m.logout()
Does anyone have any imaplib code the works with Gmail to move from inbox to another folder?
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Imaplib & Gmail - cannot move from inbox to custom folder (message remains in both) rob@attoenterprises.com - 2013-08-26 16:34 -0700
Re: Imaplib & Gmail - cannot move from inbox to custom folder (message remains in both) MRAB <python@mrabarnett.plus.com> - 2013-08-27 00:56 +0100
Re: Imaplib & Gmail - cannot move from inbox to custom folder (message remains in both) rob@attoenterprises.com - 2013-08-26 17:18 -0700
csiph-web