[Tutor] IMAP help to delete and copy messages

Magnus Lyckå magnus@thinkware.se
Thu Jun 12 08:08:01 2003


At 23:09 2003-06-11 -0700, Jacob Abraham wrote:
>    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.

If you read the documentation, you will see that this is
just what delete is supposed to do.

IMAP is fairly complex, and the documentation for imaplib
is no IMAP tutorial... See the specification
http://www.isi.edu/in-notes/rfc2060.txt for specifics.

I haven't used IMAP myself, but as far as I understand,
you need to do this in two steps.

First you need to tell the server that the client has
deleted the message.

Secondly, you expunge the mailbox, which will permanently
remove messages marked as deleted.

There are hints about this in the imaplib docs, but I fear
that you have to read through the spec or find some other
tutorial etc to figure this one out...

I think you send the message with append(), but you have to
figure out the details...


--
Magnus Lycka (It's really Lyckå), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language