From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/69026 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.user,gmane.emacs.gnus.general Subject: Re: nnimap and searching articles by message-id Date: Sat, 19 Sep 2009 11:12:33 +0200 Message-ID: <87ljkbnvr2.fsf@marauder.physik.uni-ulm.de> References: Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253351582 4068 80.91.229.12 (19 Sep 2009 09:13:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Sep 2009 09:13:02 +0000 (UTC) Cc: info-gnus-english@gnu.org, ding@gnus.org To: Peter Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sat Sep 19 11:12:52 2009 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Movzv-0005bD-SH for gegu-info-gnus-english@m.gmane.org; Sat, 19 Sep 2009 11:12:52 +0200 Original-Received: from localhost ([127.0.0.1]:35462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Movzu-0000Ml-Oo for gegu-info-gnus-english@m.gmane.org; Sat, 19 Sep 2009 05:12:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Movzr-0000JU-1a for info-gnus-english@gnu.org; Sat, 19 Sep 2009 05:12:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Movzl-0000Gm-JL for info-gnus-english@gnu.org; Sat, 19 Sep 2009 05:12:45 -0400 Original-Received: from [199.232.76.173] (port=60906 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Movzl-0000Gj-Ds for info-gnus-english@gnu.org; Sat, 19 Sep 2009 05:12:41 -0400 Original-Received: from mail.uni-ulm.de ([134.60.1.11]:32965) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Movzl-0006QU-04 for info-gnus-english@gnu.org; Sat, 19 Sep 2009 05:12:41 -0400 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.175]) by mail.uni-ulm.de (8.14.2/8.14.2) with ESMTP id n8J9CaT7009549; Sat, 19 Sep 2009 11:12:37 +0200 (MEST) Original-Received: from localhost (localhost [127.0.0.1]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id 87B341CE66; Sat, 19 Sep 2009 11:12:36 +0200 (CEST) X-Face: P05mdcZT&lL[-s2=mw~RsllZ0zZAb?vdE}.s, ding@gnus.org In-Reply-To: (Peter's message of "Sat, 19 Sep 2009 01:24:58 +0000 (UTC)") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux) X-DCC-CTc-dcc2-Metrics: poseidon 1031; Body=3 Fuz1=3 Fuz2=3 X-Virus-Scanned: by amavisd-new X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:12955 gmane.emacs.gnus.general:69026 Archived-At: On Sat, Sep 19 2009, Peter wrote: > It turns out that the IMAP server I am using Which IMAP server software is it? > requires the message-id be stripped of the enclosing angle brackets > when searching for messages like so: > > UID SEARCH HEADER Message-Id "xxxx.yyyy@foobar.com" > > Not sure who is not compliant here: Gnus/nnimap or the IMAP server? Cc-ing the developer list. Maybe someone there knows. > I found that gnus-summary-refer-article and gnus-article-refer-article > could be modified to suppress the angle brackets. That doesn't seem to > be the right solution however as I would think the fix needs to be made in > nnimap.el instead. Can anybody suggest a proper way to resolve the > problem while allowing for article referencing by message-id when > reading news through nntp and email through imap? Here's a preliminary, untested patch. Does it work for you? --8<---------------cut here---------------start------------->8--- --- nnimap.el 30 Jan 2009 18:32:29 +0100 7.59 +++ nnimap.el 19 Sep 2009 11:09:02 +0200 @@ -252,6 +252,15 @@ :type 'boolean :group 'nnimap) +(defcustom nnimap-search-mid-strip-angles t ;; nil + "Strip angles around Message-ID search. + +Some non-compliant (???) IMAP servers require to strip the angles +around Message-ID when doing an UID SEARCH." + :version "23.2" ;; No Gnus 0.12 + :group 'nnimap + :type '(choice boolean)) + (defvoo nnimap-need-unselect-to-notice-new-mail t "Unselect mailboxes before looking for new mail in them. Some servers seem to need this under some circumstances.") @@ -654,7 +663,10 @@ articles))))) (mapcar (lambda (msgid) (imap-search - (format "HEADER Message-Id \"%s\"" msgid))) + (format "HEADER Message-Id \"%s\"" + (if nnimap-search-mid-strip-angles + (gnus-replace-in-string msgid "[<>]" "") + msgid)))) articles)))) (defun nnimap-group-overview-filename (group server) --8<---------------cut here---------------end--------------->8--- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/