deleting a message with imaplib

Gerhard Häring gerhard.haering at
Mon Aug 19 17:17:25 CEST 2002

Gerhard Häring wrote:
> Am I blind or does Python's imaplib really have no means of deleting a
> message on the IMAP server? Anybody knows a patch or a workaround?

imaplib seems to be a pretty low-level interface - you need to be quite
familiar with the protocol to find it useful. Nevertheless, using a packet
sniffer I could make some sense of IMAP ;-) At least enough to solve my task.

That's the code I'm using now to "delete" a message:, 'FLAGS.SILENT', r"(\Deleted)")

where num is the message number as string.
Gerhard Häring
OPUS GmbH München
Tel.: +49 89 - 889 49 7 - 32

More information about the Python-list mailing list