On Thu, 2 Dec 2004, Tomas Pospisek's Mailing Lists wrote:
Hmm - this is starting to be interesting for me. So this means that I could switch from mailbox to mailbox by opening them READONLY and that this would not issue internally an open/close on the stream and thus not require a re-authentication?

You can switch from mailbox to mailbox regardless of whether or not they are readonly. The only thing that readonly does is prevent any changes to the mailbox (possibly including loading new messages).


So in the general case, that is for local and remote mailboxes of a random format supported by c-client I can:

        foreach mailbox in mailboxes_at_a_location {
          stream = open(mailbox, READONLY);     # first step (read)
          read_mails(stream)                    #

          stream = open(mailbox, READWRITE);    # second step (expunge)
          flag_removed_mails(stream);           #
          expunge(stream);                      #

          stream = open(mailbox, READONLY);     # third step
          append(new_mails, mailbox-name);      #
        }

If I were you, I would try to determine an algorithm that permits just one readwrite open per mailbox.


Q1: If I ommit the second step, then I can guarantee that all email stati
   are maintained, especially "Status: O" will not be set by c-client or
   the IMAP server no matter what format the mailbox is in. Correct?

"Status: O" is an artifact of traditional UNIX mailbox format, and is meaningless in other formats. If you mean the \Recent flag, the answer is "yes".


Q2: It would be interesting if there exists a way to delete emails in a
   mailbox (that is the second step) without affecting the "Status: "
   respectively the flags of any other email in that mailbox or any other
   mailbox (this again for the general case).

There isn't.

Q3: Or if there is a way to remove "Status: O" after the fact
   (afterwards). As I understand though this is not possible for the
   general case. Correct?

There isn't, and correct.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

Reply via email to