From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65857 Path: news.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: patch - nnimap - case handling in STATUS command and response Date: Mon, 03 Dec 2007 18:56:26 +0100 Message-ID: <878x4bhdbp.fsf@mocca.josefsson.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196704611 31932 80.91.229.12 (3 Dec 2007 17:56:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Dec 2007 17:56:51 +0000 (UTC) Cc: ding@gnus.org To: nathanw@MIT.EDU (Nathan J. Williams) Original-X-From: ding-owner+M14352@lists.math.uh.edu Mon Dec 03 18:57:00 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 1IzFXN-0007qj-HD for ding-account@gmane.org; Mon, 03 Dec 2007 18:56:57 +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 1IzFWv-0008Ph-0I; Mon, 03 Dec 2007 11:56:29 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IzFWt-0008PO-KO for ding@lists.math.uh.edu; Mon, 03 Dec 2007 11:56:27 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IzFWn-00054p-Dt for ding@lists.math.uh.edu; Mon, 03 Dec 2007 11:56:27 -0600 Original-Received: from yxa.extundo.com ([83.241.177.38]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IzFWk-0006B7-00 for ; Mon, 03 Dec 2007 18:56:18 +0100 Original-Received: from mocca.josefsson.org (yxa.extundo.com [83.241.177.38]) (authenticated bits=0) by yxa.extundo.com (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id lB3Hu9gU012959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Dec 2007 18:56:10 +0100 OpenPGP: id=B565716F; url=http://josefsson.org/key.txt Mail-Copies-To: nobody X-Hashcash: 1:22:071203:ding@gnus.org::iw38xFq0VFMOYLwi:J2TT X-Hashcash: 1:22:071203:nathanw@mit.edu::1wJmjrRJbliNfKDa:VeaP In-Reply-To: (Nathan J. Williams's message of "Mon, 03 Dec 2007 12:13:40 -0500") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux) X-Spam-Status: No, score=-0.0 required=4.0 tests=SPF_PASS autolearn=disabled version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on yxa-iv X-Virus-Scanned: ClamAV version 0.88.2, clamav-milter version 0.88.2 on yxa.extundo.com X-Virus-Status: Clean X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65857 Archived-At: nathanw@MIT.EDU (Nathan J. Williams) writes: > 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. Thanks, applied. Note that the server is broken here, the RFC is clear that the status-att are upper case. /Simon > - 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))