From: Reiner Steib <reinersteib+gmane@imap.cc>
To: Peter <jhrasko1@yahoo.com>
Cc: info-gnus-english@gnu.org, ding@gnus.org
Subject: Re: nnimap and searching articles by message-id
Date: Sat, 19 Sep 2009 11:12:33 +0200 [thread overview]
Message-ID: <87ljkbnvr2.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <loom.20090919T032021-30@post.gmane.org> (Peter's message of "Sat, 19 Sep 2009 01:24:58 +0000 (UTC)")
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/
next parent reply other threads:[~2009-09-19 9:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <loom.20090919T032021-30@post.gmane.org>
2009-09-19 9:12 ` Reiner Steib [this message]
2009-09-21 23:25 ` janko hrasko
2009-09-25 21:05 ` Ted Zlatanov
2009-09-25 23:41 ` Peter
2009-10-08 20:08 ` Ted Zlatanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ljkbnvr2.fsf@marauder.physik.uni-ulm.de \
--to=reinersteib+gmane@imap.cc \
--cc=Reiner.Steib@gmx.de \
--cc=ding@gnus.org \
--cc=info-gnus-english@gnu.org \
--cc=jhrasko1@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).