Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* nnir imap search does not work as expected
@ 2017-03-10 23:50 Arkady Grudzinsky
  2017-03-11  0:16 ` Eric Abrahamsen
  0 siblings, 1 reply; 7+ messages in thread
From: Arkady Grudzinsky @ 2017-03-10 23:50 UTC (permalink / raw)
  To: info-gnus-english

Hi, everyone,

I'm using Gnus to access my Gmail account via nnimap.

When I search a group using 'GG' and type query

,----
| FROM "author@domain.com"
`----

The search produces emails containing "author@domain.com" and not
necessarily in the "From:" header.

Same happens with search

,----
| SUBJECT "keyword"
`----

I get a list of emails with "keyword" anywhere in the message.

Same happens with query

,----
| +from:example@example.com
`----

which is supposed to produce "messages with example@example.com
in the From: header" as mentioned in

http://sachachua.com/blog/2008/05/emacs-gnus-searching-mail/

Is this expected behavior?  What am I missing?

-- 
Arkady



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

* Re: nnir imap search does not work as expected
  2017-03-10 23:50 nnir imap search does not work as expected Arkady Grudzinsky
@ 2017-03-11  0:16 ` Eric Abrahamsen
  2017-03-12 20:36   ` Arkady Grudzinsky
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Abrahamsen @ 2017-03-11  0:16 UTC (permalink / raw)
  To: info-gnus-english

Arkady Grudzinsky <agrudzinsky@gmail.com> writes:

> Hi, everyone,
>
> I'm using Gnus to access my Gmail account via nnimap.
>
> When I search a group using 'GG' and type query
>
> ,----
> | FROM "author@domain.com"
> `----
>
> The search produces emails containing "author@domain.com" and not
> necessarily in the "From:" header.

Imap search is pretty weird -- it wants you to specify the search key
ahead of time. If you just use GG and then type a string, it will search
all headers and the body. You can use a C-u prefix to GG to select which
key to search on (including "imap" to write the queries yourself), or
set nnir-imap-default-search-key to a different key (again, including
"imap").

Kind of weird.



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

* Re: nnir imap search does not work as expected
  2017-03-11  0:16 ` Eric Abrahamsen
@ 2017-03-12 20:36   ` Arkady Grudzinsky
  2017-03-12 21:06     ` Arkady Grudzinsky
  0 siblings, 1 reply; 7+ messages in thread
From: Arkady Grudzinsky @ 2017-03-12 20:36 UTC (permalink / raw)
  To: info-gnus-english

On Fri, Mar 10 2017, Eric Abrahamsen wrote:


[...]

> Imap search is pretty weird -- it wants you to specify the
> search key ahead of time. If you just use GG and then type a
> string, it will search all headers and the body. You can use a
> C-u prefix to GG to select which key to search on (including
> "imap" to write the queries yourself), or set
> nnir-imap-default-search-key to a different key (again,
> including "imap").

Thanks.  How can I specify the prefix?  Everything I type after
C-u seems to be interpreted as a command rather than a search
key.

And where is imap nnir search documented?

Of course, I can do GG author@domain.com and then /-a
author@domain.com, but typing the search twice does not seem
optimal to me.

-- 
Arkady



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

* Re: nnir imap search does not work as expected
  2017-03-12 20:36   ` Arkady Grudzinsky
@ 2017-03-12 21:06     ` Arkady Grudzinsky
  2017-03-12 21:20       ` Eric Abrahamsen
  0 siblings, 1 reply; 7+ messages in thread
From: Arkady Grudzinsky @ 2017-03-12 21:06 UTC (permalink / raw)
  To: info-gnus-english

On Sun, Mar 12 2017, Arkady Grudzinsky wrote:


[...]

> Thanks.  How can I specify the prefix?  Everything I type after
> C-u seems to be interpreted as a command rather than a search
> key.

OK.  Figured that out.  I need to type C-u GG, type the search
string, and THEN it asks me for the search key.

-- 
Arkady



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

* Re: nnir imap search does not work as expected
  2017-03-12 21:06     ` Arkady Grudzinsky
@ 2017-03-12 21:20       ` Eric Abrahamsen
  2017-03-13  2:15         ` Bob Newell
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Abrahamsen @ 2017-03-12 21:20 UTC (permalink / raw)
  To: info-gnus-english

Arkady Grudzinsky <agrudzinsky@gmail.com> writes:

> On Sun, Mar 12 2017, Arkady Grudzinsky wrote:
>
>
> [...]
>
>> Thanks.  How can I specify the prefix?  Everything I type after
>> C-u seems to be interpreted as a command rather than a search
>> key.
>
> OK.  Figured that out.  I need to type C-u GG, type the search
> string, and THEN it asks me for the search key.

Yup, like I said, the whole thing is a little awkward :)

It's documented in the Gnus manual: 8.1.3.2 The imap Engine

Eric



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

* Re: nnir imap search does not work as expected
  2017-03-12 21:20       ` Eric Abrahamsen
@ 2017-03-13  2:15         ` Bob Newell
  2017-03-13 20:21           ` Arkady Grudzinsky
  0 siblings, 1 reply; 7+ messages in thread
From: Bob Newell @ 2017-03-13  2:15 UTC (permalink / raw)
  To: info-gnus-english


There is another way to do this which is straightforward and allows you
to use Google search syntax, which I got from the wiki
(https://www.emacswiki.org/emacs/GnusGmail)

It has been working for me. It lets you do searches with size:, before:,
after:, from:, to: etc. Booleans work too (just remember that Google
doesn't use "and").

(add-to-list 'nnir-imap-search-arguments '("gmail" . "X-GM-RAW"))
(setq nnir-imap-default-search-key "gmail")

-- 
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *


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

* Re: nnir imap search does not work as expected
  2017-03-13  2:15         ` Bob Newell
@ 2017-03-13 20:21           ` Arkady Grudzinsky
  0 siblings, 0 replies; 7+ messages in thread
From: Arkady Grudzinsky @ 2017-03-13 20:21 UTC (permalink / raw)
  To: info-gnus-english

On Sun, Mar 12 2017, Bob Newell wrote:

> There is another way to do this which is straightforward and allows you
> to use Google search syntax, which I got from the wiki
> (https://www.emacswiki.org/emacs/GnusGmail)
>
> It has been working for me. It lets you do searches with size:, before:,
> after:, from:, to: etc. Booleans work too (just remember that Google
> doesn't use "and").
>
> (add-to-list 'nnir-imap-search-arguments '("gmail" . "X-GM-RAW"))
> (setq nnir-imap-default-search-key "gmail")

Yes!!  This is much better.  Search by rfc822msgid: also works.

Thanks!

-- 
Arkady



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

end of thread, other threads:[~2017-03-13 20:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-10 23:50 nnir imap search does not work as expected Arkady Grudzinsky
2017-03-11  0:16 ` Eric Abrahamsen
2017-03-12 20:36   ` Arkady Grudzinsky
2017-03-12 21:06     ` Arkady Grudzinsky
2017-03-12 21:20       ` Eric Abrahamsen
2017-03-13  2:15         ` Bob Newell
2017-03-13 20:21           ` Arkady Grudzinsky

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