Mailbox cleaner on an IMAP basis?
donn at drizzle.com
Tue Sep 23 08:26:23 CEST 2003
Quoth "F. GEIGER" <fgeiger at datec.at>:
| I've stopped here, because I could not figure out how to get at the ids of
| mails with attachments. And if I had that missing link, I'd run into the
| next hindrance: How can I delete a single message? IMAP4::delete() deletes a
| whole mailbox, not just a single mail.
| So my code really is only a few lines so far:
| i = IMAP4(myDomain)
| i.login(myUser, myPassword)
| i.select() # Select INBOX
| r, d = i.fetch(1, "(BODY.PEEK[HEADER.FIELDS])") # Check 1st mail
| Seems I have to get a book about IMAP and how to use it...
The IMAP4rev1 RFC of course covers these things, with examples.
2060, I think it is. A message takes two steps to delete: first,
set a \Deleted flag on it, and then invoke expunge on the folder,
which will remove all delete-flagged messages in the folder.
Donn Cave, donn at drizzle.com
More information about the Python-list