From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65856 Path: news.gmane.org!not-for-mail From: nathanw@MIT.EDU (Nathan J. Williams) Newsgroups: gmane.emacs.gnus.general Subject: patch - nnimap - case handling in STATUS command and response Date: Mon, 03 Dec 2007 12:13:40 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196702082 22267 80.91.229.12 (3 Dec 2007 17:14:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Dec 2007 17:14:42 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M14351@lists.math.uh.edu Mon Dec 03 18:14:50 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1IzEsU-0007Bs-45 for ding-account@gmane.org; Mon, 03 Dec 2007 18:14:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1IzEs8-000860-I5; Mon, 03 Dec 2007 11:14:20 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IzEs7-00085p-Fb for ding@lists.math.uh.edu; Mon, 03 Dec 2007 11:14:19 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IzEs1-0005YY-GN for ding@lists.math.uh.edu; Mon, 03 Dec 2007 11:14:19 -0600 Original-Received: from biscayne-one-station.mit.edu ([18.7.7.80]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IzEry-0005Vs-00 for ; Mon, 03 Dec 2007 18:14:10 +0100 Original-Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.13.6/8.9.2) with ESMTP id lB3HDea1021687 for ; Mon, 3 Dec 2007 12:13:41 -0500 (EST) Original-Received: from contents-vnder-pressvre.mit.edu (CONTENTS-VNDER-PRESSVRE.MIT.EDU [18.7.18.65]) (authenticated bits=56) (User authenticated as nathanw@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id lB3HDeo3004106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 3 Dec 2007 12:13:40 -0500 (EST) Original-Received: (from nathanw@localhost) by contents-vnder-pressvre.mit.edu (8.12.9.20060308) id lB3HDeUk019459; Mon, 3 Dec 2007 12:13:40 -0500 (EST) X-Scanned-By: MIMEDefang 2.42 X-Spam-Flag: NO X-Spam-Score: 0.00 X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65856 Archived-At: 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))