[plt-scheme] IMAP message positions

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Nov 11 19:29:22 EST 2002

At Mon, 11 Nov 2002 18:50:00 -0500 (EST), dvanhorn at emba.uvm.edu wrote:
> What I'm trying to do is download a set of headers and choose from the
> headers which messages need to be moved to another mailbox.  So it's something
> like...
> (imap-get-messages imap '(1 2 3) '(header))
> ...  find that message 2 needs to be moved
> (imap-copy imap '(2) dest)
> (imap-store imap '! '(2) '(deleted))
> (imap-expunge imap)
> But if a new message arrives during the ..., or even during the copy, the
> message positions would be off (presumably).  Is that right?

No - if a new message arrives, it will go to the end of the list.

The only danger is if some messages get deleted while you're trying to
move or delete, or if extra 'deleted tags get installed. I think a good
IMAP server will not let that happen (by limiting concurrent
connections to the mailbox), and I suspect that there's no way to avoid
the problem otherwise.

Probably you'll want to remove all pre-existing `deleted' flags before
the last two lines above. My experience is that it's a worthwhile


Posted on the users mailing list.