Gnus development mailing list
 help / color / mirror / Atom feed
* patch - nnimap - case handling in STATUS command and response
@ 2007-12-03 17:13 Nathan J. Williams
  2007-12-03 17:56 ` Simon Josefsson
  0 siblings, 1 reply; 6+ messages in thread
From: Nathan J. Williams @ 2007-12-03 17:13 UTC (permalink / raw)
  To: ding


The function imap-mailbox-status is careful to send tokens in
uppercase. imap-mailbox-status-async should be similarly careful. On
the receiving end, imap-parse-status needs to upcase the tokens before
applying string= to them, since the server might send them as
lowercase.

Noticed against MS Exchange 2007, which sends back STATUS tokens as
lowercase if you sent them to it as lowercase.

	- Nathan

Index: imap.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/imap.el,v
retrieving revision 7.34
diff -u -r7.34 imap.el
--- imap.el	25 Oct 2007 08:17:54 -0000	7.34
+++ imap.el	3 Dec 2007 17:12:25 -0000
@@ -1526,10 +1526,11 @@
     (imap-send-command (list "STATUS \""
 			     (imap-utf7-encode mailbox)
 			     "\" "
-			     (format "%s"
-				     (if (listp items)
-					 items
-				       (list items)))))))
+			     (upcase
+			      (format "%s"
+				      (if (listp items)
+					  items
+					(list items))))))))
 
 (defun imap-mailbox-acl-get (&optional mailbox buffer)
   "Get ACL on mailbox from server in BUFFER."
@@ -2517,7 +2518,7 @@
       (while (and (not (eq (char-after) ?\)))
 		  (or (forward-char) t)
 		  (looking-at "\\([A-Za-z]+\\) "))
-	(let ((token (match-string 1)))
+	(let ((token (upcase (match-string 1))))
 	  (goto-char (match-end 0))
 	  (cond ((string= token "MESSAGES")
 		 (imap-mailbox-put 'messages (read (current-buffer)) mailbox))



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

end of thread, other threads:[~2007-12-18 15:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-03 17:13 patch - nnimap - case handling in STATUS command and response Nathan J. Williams
2007-12-03 17:56 ` Simon Josefsson
2007-12-03 18:09   ` Nathan J. Williams
2007-12-18 15:42     ` Simon Josefsson
2007-12-03 20:43   ` Reiner Steib
2007-12-03 22:14   ` Leo

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).