Gnus development mailing list
 help / color / mirror / Atom feed
* nnimap: nnimap-request-move-article does not delete the original message
@ 2006-01-13 12:21 Andreas Vögele
  2006-01-16 21:27 ` nnimap: nnimap-request-move-article does not delete the original Danny Siu
  2006-02-17  4:47 ` nnimap: nnimap-request-move-article does not delete the original message Wolfram Fenske
  0 siblings, 2 replies; 6+ messages in thread
From: Andreas Vögele @ 2006-01-13 12:21 UTC (permalink / raw)


When moving a message from one IMAP folder to another folder the
message is copied but the original message isn't deleted.

`nnimap-request-move-article' from CVS first evaluates `accept-form',
which is set to `gnus-request-accept-article', to copy the article.
Then the original messages's \Deleted flag is set.

But `gnus-request-accept-article' selects the destination IMAP folder.
Since the source folder isn't selected again, the \Deleted flag is set
while the wrong IMAP folder is selected.

(deffoo nnimap-request-move-article (article group server accept-form 
				     &optional last move-is-internal)
  [...]
	     (save-excursion
               [....]
	       (setq result (eval accept-form))
               [...]
	       result)
	     (imap-message-flags-add
	      (imap-range-to-message-set (list article))
	      "\\Deleted" 'silent nnimap-server-buffer))
	result))))

Here's an example from the IMAP log.  Message 1284 is moved from INBOX
to INBOX.Test.

100 UID COPY 1284 "INBOX.Test"
100 OK [COPYUID 1133556790 1284 173] Completed
101 SELECT "INBOX.Test"
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotJunk JunkRecorded $Junk gnus-save gnus-expire)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotJunk JunkRecorded $Junk gnus-save gnus-expire \*)]  
* 36 EXISTS
* 1 RECENT
* OK [UNSEEN 36]  
* OK [UIDVALIDITY 1133556790]  
* OK [UIDNEXT 174]  
101 OK [READ-WRITE] Completed
102 UID STORE 173 -FLAGS (\Seen)
102 OK Completed
103 UID STORE 1284 +FLAGS.SILENT (\Deleted)
103 OK Completed
[...]
113 STATUS "INBOX.Test" (UNSEEN)
* STATUS INBOX.Test (UNSEEN 0)
113 OK Completed
114 EXPUNGE
* 36 EXISTS
* 1 RECENT
114 OK Completed
115 SELECT "INBOX"
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen gnus-expire $NotJunk JunkRecorded $Junk)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen gnus-expire $NotJunk JunkRecorded $Junk \*)]  
* 139 EXISTS
* 0 RECENT
* OK [UNSEEN 139]  
* OK [UIDVALIDITY 1133556790]  
* OK [UIDNEXT 1285]  
115 OK [READ-WRITE] Completed
[...]
119 EXPUNGE
* 139 EXISTS
* 0 RECENT
119 OK Completed

Here's the debug output from nnimap:

1 -> nnimap-request-article: article=1284 group="INBOX" server="private" to-buffer=#<buffer *Article*>
| 2 -> nnimap-request-article-part: article=1284 part="BODY.PEEK[]" prop=BODYDETAIL group="INBOX" server="private" to-buffer=#<buff
er *Article*> detail=detail
| | 3 -> nnimap-possibly-change-group: group="INBOX" server="private"
| | | 4 -> nnimap-possibly-change-server: server="private"
| | | 4 <- nnimap-possibly-change-server: " *nnimap* private"
| | 3 <- nnimap-possibly-change-group: "INBOX"
| 2 <- nnimap-request-article-part: ("INBOX" . 1284)
1 <- nnimap-request-article: ("INBOX" . 1284)
======================================================================
1 -> nnimap-server-opened: server="private"
1 <- nnimap-server-opened: (run)
======================================================================
1 -> nnimap-request-move-article: article=1284 group="INBOX" server="private" accept-form=(gnus-request-accept-article "nnimap+private: INBOX.Test" (quote nil) t t) last=t move-is-internal=t
| 2 -> nnimap-possibly-change-server: server="private"
| 2 <- nnimap-possibly-change-server: " *nnimap* private"
| 2 -> nnimap-request-accept-article: group="INBOX.Test" server="private" last=t
| | 3 -> nnimap-possibly-change-server: server="private"
| | 3 <- nnimap-possibly-change-server: " *nnimap* private"
| | 3 -> nnimap-possibly-change-group: group="INBOX" server=nil
| | | 4 -> nnimap-possibly-change-server: server=nil
| | | 4 <- nnimap-possibly-change-server: " *nnimap* private"
| | 3 <- nnimap-possibly-change-group: "INBOX"
| 2 <- nnimap-request-accept-article: ("INBOX.Test" . 173)
| 2 -> nnimap-request-set-mark: group="INBOX.Test" actions=(((173) del (read))) server="private"
| | 3 -> nnimap-possibly-change-group: group="INBOX.Test" server="private"
| | | 4 -> nnimap-possibly-change-server: server="private"
| | | 4 <- nnimap-possibly-change-server: " *nnimap* private"
| | | 4 -> nnimap-verify-uidvalidity: group="INBOX.Test" server="private"
| | | 4 <- nnimap-verify-uidvalidity: nil
| | 3 <- nnimap-possibly-change-group: "INBOX.Test"
| | 3 -> nnimap-mark-to-flag: preds=read always-list=nil make-string=nil
| | | 4 -> nnimap-mark-to-flag-1: preds=read
| | | 4 <- nnimap-mark-to-flag-1: "\\Seen"
| | 3 <- nnimap-mark-to-flag: "\\Seen"
| | 3 -> nnimap-mark-to-flag: preds=(read) always-list=nil make-string=t
| | | 4 -> nnimap-mark-to-flag-1: preds=(read)
| | | | 5 -> nnimap-mark-to-flag: preds=read always-list=nil make-string=nil
| | | | | 6 -> nnimap-mark-to-flag-1: preds=read
| | | | | 6 <- nnimap-mark-to-flag-1: "\\Seen"
| | | | 5 <- nnimap-mark-to-flag: "\\Seen"
| | | | 5 -> nnimap-mark-to-flag: preds=nil always-list=nil make-string=nil
| | | | | 6 -> nnimap-mark-to-flag-1: preds=nil
| | | | | 6 <- nnimap-mark-to-flag-1: nil
| | | | 5 <- nnimap-mark-to-flag: nil
| | | 4 <- nnimap-mark-to-flag-1: ("\\Seen")
| | 3 <- nnimap-mark-to-flag: "\\Seen"
| 2 <- nnimap-request-set-mark: nil
1 <- nnimap-request-move-article: ("INBOX.Test" . 173)

And here's an excerpt from the imap debugging output:

| | 3 -> imap-message-copy: articles="1284" mailbox="INBOX.Test" dont-create=dontcreate no-copyuid=nil buffer=" *nnimap* private"
| | | 4 -> imap-send-command-wait: command="UID COPY 1284 \"INBOX.Test\"" buffer=nil
| | | | 5 -> imap-send-command: command="UID COPY 1284 \"INBOX.Test\"" buffer=nil
| | | | | 6 -> imap-send-command-1: cmdstr="100 UID COPY 1284 \"INBOX.Test\""
| | | | | 6 <- imap-send-command-1: nil
| | | | 5 <- imap-send-command: 100
| | | | 5 -> imap-wait-for-tag: tag=100 buffer=nil
| | | | | 6 -> imap-arrival-filter: proc=#<process imap> string="100 OK [COPYUID 1133556790 1284 173] Completed
"
| | | | | | 7 -> imap-find-next-line: 
| | | | | | 7 <- imap-find-next-line: 49
| | | | | | 7 -> imap-parse-response: 
| | | | | | | 8 -> imap-parse-resp-text: 
| | | | | | | | 9 -> imap-parse-resp-text-code: 
| | | | | | | | | 10 -> imap-mailbox-put: propname=copyuid value=("1133556790" "1284" "173") mailbox="INBOX.Test" buffer=nil
| | | | | | | | | 10 <- imap-mailbox-put: t
| | | | | | | | 9 <- imap-parse-resp-text-code: t
| | | | | | | 8 <- imap-parse-resp-text: t
| | | | | | 7 <- imap-parse-response: nil
| | | | | | 7 -> imap-find-next-line: 
| | | | | | 7 <- imap-find-next-line: nil
| | | | | 6 <- imap-arrival-filter: nil
| | | | 5 <- imap-wait-for-tag: OK
| | | 4 <- imap-send-command-wait: OK
| | | 4 -> imap-message-copyuid-1: mailbox="INBOX.Test"
| | | | 5 -> imap-capability: identifier=UIDPLUS buffer=nil
| | | | 5 <- imap-capability: (UIDPLUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE IDLE AUTH=PLAIN AUTH=LOGIN AUTH=GSSAPI SASL-IR LISTEXT LIST-SUBSCRIBED)
| | | 4 <- imap-message-copyuid-1: ("1133556790" 173)
| | 3 <- imap-message-copy: ("1133556790" 173)
| | | 4 -> imap-current-mailbox-p: mailbox="INBOX.Test" examine=nil buffer=nil
| | | | 5 -> imap-current-mailbox-p-1: mailbox="INBOX.Test" examine=nil
| | | | 5 <- imap-current-mailbox-p-1: nil
| | | 4 <- imap-current-mailbox-p: nil
| | | 4 -> imap-mailbox-select: mailbox="INBOX.Test" examine=nil buffer=nil
| | | | 5 -> imap-mailbox-select-1: mailbox="INBOX.Test" examine=nil
| | | | | 6 -> imap-current-mailbox-p-1: mailbox="INBOX.Test" examine=nil
| | | | | 6 <- imap-current-mailbox-p-1: nil
| | | | | 6 -> imap-send-command-wait: command="SELECT \"INBOX.Test\"" buffer=nil
| | | | | | 7 -> imap-send-command: command="SELECT \"INBOX.Test\"" buffer=nil
| | | | | | | 8 -> imap-send-command-1: cmdstr="101 SELECT \"INBOX.Test\""
| | | | | | | 8 <- imap-send-command-1: nil
| | | | | | 7 <- imap-send-command: 101
| | | | | | 7 -> imap-wait-for-tag: tag=101 buffer=nil
| | | | | | | 8 -> imap-arrival-filter: proc=#<process imap> string="* FLAGS (\\Answered \\Flagged \\Draft \\Deleted \\Seen $NotJunk JunkRecorded $Junk gnus-save gnus-expire)
* OK [PERMANENTFLAGS (\\Answered \\Flagged \\Draft \\Deleted \\Seen $NotJunk JunkRecorded $Junk gnus-save gnus-expire \\*)]  
* 36 EXISTS
* 1 RECENT
* OK [UNSEEN 36]  
* OK [UIDVALIDITY 1133556790]  
* OK [UIDNEXT 174]  
101 OK [READ-WRITE] Completed
"
| | | | | | | | 9 -> imap-find-next-line: 
| | | | | | | | 9 <- imap-find-next-line: 103
| | | | | | | | 9 -> imap-parse-response: 
| | | | | | | | | 10 -> imap-parse-flag-list: 
| | | | | | | | | 10 <- imap-parse-flag-list: ("\\Answered" "\\Flagged" "\\Draft" "\\Deleted" "\\Seen" "$NotJunk" "JunkRecorded" "$Junk" "gnus-save" "gnus-expire")
| | | | | | | | | 10 -> imap-mailbox-put: propname=flags value=("\\Answered" "\\Flagged" "\\Draft" "\\Deleted" "\\Seen" "$NotJunk" "JunkRecorded" "$Junk" "gnus-save" "gnus-expire") mailbox=nil buffer=nil
| | | | | | | | | 10 <- imap-mailbox-put: t
| | | | | | | | 9 <- imap-parse-response: t
| | | | | | | | 9 -> imap-find-next-line: 
| | | | | | | | 9 <- imap-find-next-line: 122
| | | | | | | | 9 -> imap-parse-response: 
| | | | | | | | | 10 -> imap-parse-resp-text: 
| | | | | | | | | | 11 -> imap-parse-resp-text-code: 
| | | | | | | | | | | 12 -> imap-parse-flag-list: 
| | | | | | | | | | | 12 <- imap-parse-flag-list: ("\\Answered" "\\Flagged" "\\Draft" "\\Deleted" "\\Seen" "$NotJunk" "JunkRecorded" "$Junk" "gnus-save" "gnus-expire" "\\*")
| | | | | | | | | | | 12 -> imap-mailbox-put: propname=permanentflags value=("\\Answered" "\\Flagged" "\\Draft" "\\Deleted" "\\Seen" "$NotJunk" "JunkRecorded" "$Junk" "gnus-save" "gnus-expire" "\\*") mailbox=nil buffer=nil
| | | | | | | | | | | 12 <- imap-mailbox-put: t
| | | | | | | | | | 11 <- imap-parse-resp-text-code: t
| | | | | | | | | 10 <- imap-parse-resp-text: t
| | | | | | | | 9 <- imap-parse-response: t
| | | | | | | | 9 -> imap-find-next-line: 
| | | | | | | | 9 <- imap-find-next-line: 14
| | | | | | | | 9 -> imap-parse-response: 
| | | | | | | | | 10 -> imap-mailbox-put: propname=exists value=36 mailbox=nil buffer=nil
| | | | | | | | | 10 <- imap-mailbox-put: t
| | | | | | | | 9 <- imap-parse-response: t
| | | | | | | | 9 -> imap-find-next-line: 
| | | | | | | | 9 <- imap-find-next-line: 13
| | | | | | | | 9 -> imap-parse-response: 
| | | | | | | | | 10 -> imap-mailbox-put: propname=recent value=1 mailbox=nil buffer=nil
| | | | | | | | | 10 <- imap-mailbox-put: t
| | | | | | | | 9 <- imap-parse-response: t
| | | | | | | | 9 -> imap-find-next-line: 
| | | | | | | | 9 <- imap-find-next-line: 21
| | | | | | | | 9 -> imap-parse-response: 
| | | | | | | | | 10 -> imap-parse-resp-text: 
| | | | | | | | | | 11 -> imap-parse-resp-text-code: 
| | | | | | | | | | | 12 -> imap-mailbox-put: propname=first-unseen value=36 mailbox=nil buffer=nil
| | | | | | | | | | | 12 <- imap-mailbox-put: t
| | | | | | | | | | 11 <- imap-parse-resp-text-code: t
| | | | | | | | | 10 <- imap-parse-resp-text: t
| | | | | | | | 9 <- imap-parse-response: t
| | | | | | | | 9 -> imap-find-next-line: 
| | | | | | | | 9 <- imap-find-next-line: 34
| | | | | | | | 9 -> imap-parse-response: 
| | | | | | | | | 10 -> imap-parse-resp-text: 
| | | | | | | | | | 11 -> imap-parse-resp-text-code: 
| | | | | | | | | | | 12 -> imap-mailbox-put: propname=uidvalidity value="1133556790" mailbox=nil buffer=nil
| | | | | | | | | | | 12 <- imap-mailbox-put: t
| | | | | | | | | | 11 <- imap-parse-resp-text-code: t
| | | | | | | | | 10 <- imap-parse-resp-text: t
| | | | | | | | 9 <- imap-parse-response: t
| | | | | | | | 9 -> imap-find-next-line: 
| | | | | | | | 9 <- imap-find-next-line: 23
| | | | | | | | 9 -> imap-parse-response: 
| | | | | | | | | 10 -> imap-parse-resp-text: 
| | | | | | | | | | 11 -> imap-parse-resp-text-code: 
| | | | | | | | | | 11 <- imap-parse-resp-text-code: nil
| | | | | | | | | 10 <- imap-parse-resp-text: nil
| | | | | | | | 9 <- imap-parse-response: nil
| | | | | | | | 9 -> imap-find-next-line: 
| | | | | | | | 9 <- imap-find-next-line: 32
| | | | | | | | 9 -> imap-parse-response: 
| | | | | | | | | 10 -> imap-parse-resp-text: 
| | | | | | | | | | 11 -> imap-parse-resp-text-code: 
| | | | | | | | | | 11 <- imap-parse-resp-text-code: nil
| | | | | | | | | 10 <- imap-parse-resp-text: nil
| | | | | | | | 9 <- imap-parse-response: nil
| | | | | | | | 9 -> imap-find-next-line: 
| | | | | | | | 9 <- imap-find-next-line: nil
| | | | | | | 8 <- imap-arrival-filter: nil
| | | | | | 7 <- imap-wait-for-tag: OK
| | | | | 6 <- imap-send-command-wait: OK
| | | | 5 <- imap-mailbox-select-1: "INBOX.Test"
| | | 4 <- imap-mailbox-select: "INBOX.Test"
| | | | 5 -> imap-mailbox-get: propname=uidvalidity mailbox=nil buffer=nil
| | | | 5 <- imap-mailbox-get: "1133556790"
| | | 4 -> imap-mailbox-get: propname=exists mailbox="INBOX.Test" buffer=nil
| | | 4 <- imap-mailbox-get: 36
| | 3 -> imap-message-flag-permanent-p: flag="\\Seen" mailbox=nil buffer=nil
| | | 4 -> imap-mailbox-get: propname=permanentflags mailbox=nil buffer=nil
| | | 4 <- imap-mailbox-get: ("\\Answered" "\\Flagged" "\\Draft" "\\Deleted" "\\Seen" "$NotJunk" "JunkRecorded" "$Junk" "gnus-save" "gnus-expire" "\\*")
| | 3 <- imap-message-flag-permanent-p: ("\\*")
| | 3 -> imap-message-flags-del: articles="173" flags="\\Seen" silent=nil buffer=nil
| | | 4 -> imap-send-command-wait: command="UID STORE 173 -FLAGS (\\Seen)" buffer=nil
| | | | 5 -> imap-send-command: command="UID STORE 173 -FLAGS (\\Seen)" buffer=nil
| | | | | 6 -> imap-send-command-1: cmdstr="102 UID STORE 173 -FLAGS (\\Seen)"
| | | | | 6 <- imap-send-command-1: nil
| | | | 5 <- imap-send-command: 102
| | | | 5 -> imap-wait-for-tag: tag=102 buffer=nil
| | | | | 6 -> imap-arrival-filter: proc=#<process imap> string="102 OK Completed
"
| | | | | | 7 -> imap-find-next-line: 
| | | | | | 7 <- imap-find-next-line: 19
| | | | | | 7 -> imap-parse-response: 
| | | | | | | 8 -> imap-parse-resp-text: 
| | | | | | | | 9 -> imap-parse-resp-text-code: 
| | | | | | | | 9 <- imap-parse-resp-text-code: nil
| | | | | | | 8 <- imap-parse-resp-text: nil
| | | | | | 7 <- imap-parse-response: nil
| | | | | | 7 -> imap-find-next-line: 
| | | | | | 7 <- imap-find-next-line: nil
| | | | | 6 <- imap-arrival-filter: nil
| | | | 5 <- imap-wait-for-tag: OK
| | | 4 <- imap-send-command-wait: OK
| | 3 <- imap-message-flags-del: t
| 2 -> imap-message-flags-add: articles="1284" flags="\\Deleted" silent=silent buffer=" *nnimap* private"
| | 3 -> imap-send-command-wait: command="UID STORE 1284 +FLAGS.SILENT (\\Deleted)" buffer=nil
| | | 4 -> imap-send-command: command="UID STORE 1284 +FLAGS.SILENT (\\Deleted)" buffer=nil
| | | | 5 -> imap-send-command-1: cmdstr="103 UID STORE 1284 +FLAGS.SILENT (\\Deleted)"
| | | | 5 <- imap-send-command-1: nil
| | | 4 <- imap-send-command: 103
| | | 4 -> imap-wait-for-tag: tag=103 buffer=nil
| | | | 5 -> imap-arrival-filter: proc=#<process imap> string="103 OK Completed
"
| | | | | 6 -> imap-find-next-line: 
| | | | | 6 <- imap-find-next-line: 19
| | | | | 6 -> imap-parse-response: 
| | | | | | 7 -> imap-parse-resp-text: 
| | | | | | | 8 -> imap-parse-resp-text-code: 
| | | | | | | 8 <- imap-parse-resp-text-code: nil
| | | | | | 7 <- imap-parse-resp-text: nil
| | | | | 6 <- imap-parse-response: nil
| | | | | 6 -> imap-find-next-line: 
| | | | | 6 <- imap-find-next-line: nil
| | | | 5 <- imap-arrival-filter: nil
| | | 4 <- imap-wait-for-tag: OK
| | 3 <- imap-send-command-wait: OK
| 2 <- imap-message-flags-add: t
| | 3 -> imap-current-mailbox-p: mailbox="INBOX.Test" examine=nil buffer=nil
| | | 4 -> imap-current-mailbox-p-1: mailbox="INBOX.Test" examine=nil




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-02-21  7:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-13 12:21 nnimap: nnimap-request-move-article does not delete the original message Andreas Vögele
2006-01-16 21:27 ` nnimap: nnimap-request-move-article does not delete the original Danny Siu
2006-01-17 23:09   ` Sebastian Tennant
2006-02-17  4:47 ` nnimap: nnimap-request-move-article does not delete the original message Wolfram Fenske
2006-02-21  2:28   ` nnimap: nnimap-request-move-article does not delete the original Danny Siu
2006-02-21  7:14     ` Katsumi Yamaoka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).