Subject: how to notify IMAP server about the folder update?

From: Vadim Zeitlin <[email-masked]>
Date: Mon, 25 Jun 2001 21:22:17 +0200 (CET)

Hello,

 I'm using mail_copy_full() in my code to copy/move messages from one folder
on the IMAP server to another and globally it works just as expected but
sometimes, if the destination folder is opened in the program, the server
fails to notice the new message in it and I have to close and reopen it to see
them. I wonder if this is normal behaviour for the server (I've only seen it
with the old "IMAP4rev1 v12.264" but as it happens very rarely I'm not sure it
doesn't happen with other servers, which I use only briefly for testing, too)?

 And, if it is normal, is there any way to tell the server that the folder had
been updated? Of course, I don't want to close/reopen the destination folder
each time as it is quite time consuming.

 Thanks!
VZ

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Mon, 25 Jun 2001 13:19:02 -0700 (PDT)

> doesn't happen with other servers, which I use only briefly for testing, too)?

The behavior that you describe isn't forbidden, but it isn't good either.
It is a safe assumption that if the server doesn't see new mail until the
next session, there is a reason why this is the case.  Whether it is a
good reason or not is another matter.

However, since there's a reason why the server didn't see the new mail, it
is unlikely to be anything that you can to at the client end to make it
see the new mail short of making a new session (either a new SELECT or a
new IMAP server session).

I do not think that making a new session automatically is a good idea.
In fact, I think that any client that routinely re-selects the same
mailbox over and over again is a terrible client, and system management
would be justified in banning its use.

In other words, my advice is: "assume that servers are well-behaved. If a
server is badly-behaved, don't try to fix it; you're likely to escalate a
minor problem into a major problem."

Now, as for reasons.  Was the mailbox read-only in the server that had it
selected?  In mail stores, new mail is not noticed if the mailbox is
read-only.

If this problem is specific for older servers and not for modern servers,
I would re-iterate my advice given above.  Don't worry about broken older
servers.  The fix is to upgrade to modern servers.

-- Mark --

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