* Changes in 2.16.0 from 2.14.x
+** Prevent accidental loss of messages when renaming IMAP folder
+
** Put spam mark on the message registered as spam.
** Remove spam mark from the message registered as non-spam.
+2011-07-03 David Maus <dmaus@ictsoc.de>
+
+ * elmo-imap4.el (elmo-imap4-session-unselect-mailbox): New
+ function. Leave selected state without silent EXPUNGE.
+ (elmo-folder-rename-internal): Use function.
+
2011-06-03 David Maus <dmaus@ictsoc.de>
* elmo-imap4.el (elmo-imap4-fetch-callback-1-subr): Don't mark
(format "Select %s failed" mailbox)))))))
(and result response))))
+(defun elmo-imap4-session-unselect-mailbox (session mailbox)
+ "Unselect MAILBOX in SESSION.
+Deselecting will exit selected state without causing silent
+EXPUNGE for deleted messages."
+ (if (elmo-imap4-session-capable-p session 'unselect)
+ (elmo-imap4-send-command-wait session "unselect")
+ (elmo-imap4-send-command-wait
+ session
+ (list "examine " (elmo-imap4-mailbox mailbox)))
+ (elmo-imap4-send-command-wait session "close")))
+
(defun elmo-imap4-check-validity (spec validity-file)
;;; Not used.
;;;(elmo-imap4-send-command-wait
(elmo-imap4-session-select-mailbox session
(elmo-imap4-folder-mailbox-internal
folder))
+ (elmo-imap4-session-unselect-mailbox session
+ (elmo-imap4-folder-mailbox-internal
+ folder))
(elmo-imap4-send-command-wait session "close")
(elmo-imap4-send-command-wait
session