$Log$
+ Revision 613.1 2003/12/19 04:33:52 ajc
+ * Changes to auto-expunge algorithm to support correct behavior in
+ some IMAP clients while moving messages.
+
Revision 613.0 2003/12/15 16:37:01 ajc
* THIS IS 6.13
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
if (!ok) {
cprintf("%s NO ... no such room, or access denied\r\n",
parms[0]);
- IMAP->selected = 0;
+ /* IMAP->selected = 0; */
return;
}
+ /* If we already had some other folder selected, auto-expunge it */
+ imap_do_expunge();
+
/*
* usergoto() formally takes us to the desired room, happily returning
* the number of messages and number of new messages.
cprintf("* %d EXISTS\r\n", msgs);
cprintf("* %d RECENT\r\n", new);
+
+ /* Note that \Deleted is a valid flag, but not a permanent flag,
+ * because we don't maintain its state across sessions. Citadel
+ * automatically expunges mailboxes when they are de-selected.
+ */
cprintf("* FLAGS (\\Deleted \\Seen \\Answered)\r\n");
- cprintf("* OK [PERMANENTFLAGS (\\Deleted \\Seen \\Answered)] "
+ cprintf("* OK [PERMANENTFLAGS (\\Seen \\Answered)] "
"permanent flags\r\n");
+
cprintf("* OK [UIDVALIDITY 0] UIDs valid\r\n");
cprintf("%s OK [%s] %s completed\r\n",
parms[0],
int i;
int num_expunged = 0;
+ lprintf(9, "imap_do_expunge() called\n");
+ if (IMAP->selected == 0) return(0);
+
if (IMAP->num_msgs > 0) for (i=0; i<IMAP->num_msgs; ++i) {
if (IMAP->flags[i] & IMAP_DELETED) {
CtdlDeleteMessages(CC->room.QRname,
}
else if (!strcasecmp(parms[1], "LOGOUT")) {
+ imap_do_expunge(); /* yes, we auto-expunge */
cprintf("* BYE %s logging out\r\n", config.c_fqdn);
cprintf("%s OK thank you for using Citadel IMAP\r\n", parms[0]);
CC->kill_me = 1;