Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #75803 > unrolled thread
| Started by | elearn <elearn2014@gmail.com> |
|---|---|
| First post | 2014-08-06 22:03 +0800 |
| Last post | 2014-08-06 22:03 +0800 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
why i can not delete my email with imaplib? elearn <elearn2014@gmail.com> - 2014-08-06 22:03 +0800
| From | elearn <elearn2014@gmail.com> |
|---|---|
| Date | 2014-08-06 22:03 +0800 |
| Subject | why i can not delete my email with imaplib? |
| Message-ID | <mailman.12703.1407336221.18130.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
I have a gmail account 'xxx@gmail.com' which subscripted python
maillist. I want to delete any emails which is sent to
python-list@python.org .
|import imaplib
user="xxx"
password="yyyyyy"
con=imaplib.IMAP4_SSL('imap.gmail.com')
con.login(user,password)
con.select('[Gmail]/&YkBnCZCuTvY-')
type, data= con.search(None, "All")
type1, data1= con.search(None, '(TO "python-list@python.org")')
ids_all= set(data[0].split())
ids1=set(data1[0].split())
ids_deleted=set(ids_all-ids1)
for numin ids_deleted:
con.store(num, '+FLAGS', '\\Deleted')
con.expunge()|
When i open my gmail with thunderbird ,the emails which are sent to
python-list@python.org are still in my gmail,Why i can't delete them?
Back to top | Article view | comp.lang.python
csiph-web