On Wed, 1 Dec 2004, Mark Crispin wrote:
On Wed, 1 Dec 2004, Tomas Pospisek's Mailing Lists wrote:... but - are you saying that I don't even need to change into HALFOPEN mode in order to be able to append messages to any kind of mailbox without the "Status: O" flag being set? That I just have to keep the stream in READONLY mode?
Stream readonly status refers to operations on the opened mailbox (the selected mailbox in IMAP terms); it affects such operations as setting/clearing flags and expunging. It does not in any way affect operations that work on a mailbox by name, such as append.
So I think that the answer to your question (if I understand it correctly) is "yes".
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?
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); #
}
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?
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).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? If any of the two (preferable the later method - removing "Status: O")
could be achieved, then mailsync could be implemented in a "perfect"
way.Thanks, *t
-- ----------------------------------------------------------- Tomas Pospisek http://sourcepole.com - Linux & Open Source Solutions -----------------------------------------------------------
