* Searching from a folder
@ 2012-09-29 8:57 Damien Cassou
2012-09-29 10:58 ` Jani Nikula
2012-09-29 16:12 ` Austin Clements
0 siblings, 2 replies; 7+ messages in thread
From: Damien Cassou @ 2012-09-29 8:57 UTC (permalink / raw)
To: notmuch
Hi,
I can't make notmuch search return the list of mails in [Gmail]
folders for a particular mailbox:
~ $ notmuch search folder:"[Gmail].All Mail"
~ $ notmuch search folder:[Gmail].Important
but these folders actually contain emails. This works well for another
gmail mailbox I have. You can reproduce by using the following
configuration files (yes, the password is here, that's just a test
account, don't worry):
===================
~/.offlineimaprc
===================
[Account GmailTest]
localrepository = LocalGmailTest
remoterepository = RemoteGmailTest
[Repository LocalGmailTest]
type = Maildir
localfolders = /home/XXXXXXXXXXXXXX/Mail/GmailTest
[Repository RemoteGmailTest]
type = IMAP
remotehost = imap.gmail.com
remoteuser = damien.test.cassou@gmail.com
remotepass = babebibob
ssl = yes
cert_fingerprint = f3043dd689a2e7dddfbef82703a6c65ea9b634c1
maxconnections = 1
realdelete = no
===================
~/.notmuch-config
===================
[database]
path=/home/XXXXXXXXXXXXXXXXXXXX/Mail/GmailTest
[user]
name=Damien Cassou
primary_email=damien.test.cassou@gmail.com
other_email=#xxxxxx
[new]
tags=
[search]
exclude_tags=deleted;spam;
[maildir]
synchronize_flags=true
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Searching from a folder
2012-09-29 8:57 Searching from a folder Damien Cassou
@ 2012-09-29 10:58 ` Jani Nikula
2012-09-29 13:17 ` Damien Cassou
2012-09-29 16:12 ` Austin Clements
1 sibling, 1 reply; 7+ messages in thread
From: Jani Nikula @ 2012-09-29 10:58 UTC (permalink / raw)
To: Damien Cassou, notmuch
On Sat, 29 Sep 2012, Damien Cassou <damien.cassou@gmail.com> wrote:
> I can't make notmuch search return the list of mails in [Gmail]
> folders for a particular mailbox:
>
> ~ $ notmuch search folder:"[Gmail].All Mail"
> ~ $ notmuch search folder:[Gmail].Important
So you have folders named like that in your maildir? It *should* of
course work with proper escapes and/or quoting, but for the exact reason
of avoiding such trouble, I use this in the section corresponding to
your [Repository RemoteGmailTest] of the .offlineimaprc:
nametrans = lambda foldername: re.sub('^\[Gmail\]/All Mail', 'gmail', foldername)
I only sync all mail and inbox, so you may need to modify that to your
needs.
Also note that if you have maildir.synchronize_flags=true, the gmail
"Starred" should sync to maildir flag F, which in turn syncs to notmuch
tag:flagged.
HTH,
Jani.
> but these folders actually contain emails. This works well for another
> gmail mailbox I have. You can reproduce by using the following
> configuration files (yes, the password is here, that's just a test
> account, don't worry):
PS. You should probably change the password anyway. You don't want
Mallory to do stuff like send tons of spam using your account. There are
no "test accounts" from gmail POV.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Searching from a folder
2012-09-29 10:58 ` Jani Nikula
@ 2012-09-29 13:17 ` Damien Cassou
0 siblings, 0 replies; 7+ messages in thread
From: Damien Cassou @ 2012-09-29 13:17 UTC (permalink / raw)
To: Jani Nikula; +Cc: notmuch
On Sat, Sep 29, 2012 at 12:58 PM, Jani Nikula <jani@nikula.org> wrote:
> So you have folders named like that in your maildir? It *should* of
> course work with proper escapes and/or quoting
it works exactly like that with my main gmail account, with exactly
the same folder name.
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Searching from a folder
2012-09-29 8:57 Searching from a folder Damien Cassou
2012-09-29 10:58 ` Jani Nikula
@ 2012-09-29 16:12 ` Austin Clements
2012-10-01 9:42 ` Damien Cassou
1 sibling, 1 reply; 7+ messages in thread
From: Austin Clements @ 2012-09-29 16:12 UTC (permalink / raw)
To: Damien Cassou; +Cc: notmuch
Quoth Damien Cassou on Sep 29 at 10:57 am:
> Hi,
>
> I can't make notmuch search return the list of mails in [Gmail]
> folders for a particular mailbox:
>
> ~ $ notmuch search folder:"[Gmail].All Mail"
> ~ $ notmuch search folder:[Gmail].Important
You need to properly escape these, both for the shell and for Xapian.
Try,
$ notmuch search 'folder:"[Gmail].All Mail"'
$ notmuch search 'folder:"[Gmail].Important"'
The single quotes are necessary to get the inner quoting through to
Xapian (lest the shell strip them away before notmuch even gets a hold
of its arguments) and the double quotes are necessary because folder
is a "probabilistic prefix", and one of many consequences of that is
that "folder:" won't be parsed as a prefix if it's followed by an
unusual character like '['.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Searching from a folder
2012-09-29 16:12 ` Austin Clements
@ 2012-10-01 9:42 ` Damien Cassou
2012-10-01 12:16 ` Austin Clements
0 siblings, 1 reply; 7+ messages in thread
From: Damien Cassou @ 2012-10-01 9:42 UTC (permalink / raw)
To: Austin Clements; +Cc: notmuch
On Sat, Sep 29, 2012 at 6:12 PM, Austin Clements <amdragon@mit.edu> wrote:
> $ notmuch search 'folder:"[Gmail].All Mail"'
> $ notmuch search 'folder:"[Gmail].Important"'
thank you very much, it indeed works. I'm still a bit puzzled by the
fact that, on my other mailbox, I'm getting the following results:
$ notmuch search 'folder:"[Gmail].Important"' | wc --lines
8928
$ notmuch search folder:[Gmail].Important | wc --lines
138
So, without using quoting, something is indeed happening. Do you know what?
Thank you
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Searching from a folder
2012-10-01 9:42 ` Damien Cassou
@ 2012-10-01 12:16 ` Austin Clements
2012-10-01 15:01 ` Damien Cassou
0 siblings, 1 reply; 7+ messages in thread
From: Austin Clements @ 2012-10-01 12:16 UTC (permalink / raw)
To: Damien Cassou; +Cc: notmuch
Quoth Damien Cassou on Oct 01 at 11:42 am:
> On Sat, Sep 29, 2012 at 6:12 PM, Austin Clements <amdragon@mit.edu> wrote:
> > $ notmuch search 'folder:"[Gmail].All Mail"'
> > $ notmuch search 'folder:"[Gmail].Important"'
>
> thank you very much, it indeed works. I'm still a bit puzzled by the
> fact that, on my other mailbox, I'm getting the following results:
>
> $ notmuch search 'folder:"[Gmail].Important"' | wc --lines
> 8928
> $ notmuch search folder:[Gmail].Important | wc --lines
> 138
>
> So, without using quoting, something is indeed happening. Do you know what?
In the latter case, you're finding emails that contain the words
"folder" (or words like folder), "gmail", and "important".
$ NOTMUCH_DEBUG_QUERY=1 notmuch search 'folder:"[Gmail].Important"'
Final query is:
Xapian::Query((Tmail AND (XFOLDERgmail:(pos=1) PHRASE 2 XFOLDERimportant:(pos=2))))
This is slightly inscrutable, but you can see that it applied the
folder prefix ("XFOLDER") to both "gmail" and "important" and required
that the two terms appear in a phrase (that is, next to each other).
$ NOTMUCH_DEBUG_QUERY=1 notmuch search 'folder:[Gmail].Important'
Final query is:
Xapian::Query((Tmail AND Zfolder:(pos=1) AND gmail:(pos=2) AND important:(pos=3)))
Whereas here, it's searching for folder, gmail, and important as
regular and completely independent terms (the Z on folder means it's
stemmed, so it will match folders, foldered, etc.)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Searching from a folder
2012-10-01 12:16 ` Austin Clements
@ 2012-10-01 15:01 ` Damien Cassou
0 siblings, 0 replies; 7+ messages in thread
From: Damien Cassou @ 2012-10-01 15:01 UTC (permalink / raw)
To: Austin Clements; +Cc: notmuch
On Mon, Oct 1, 2012 at 2:16 PM, Austin Clements <amdragon@mit.edu> wrote:
>
> Whereas here, it's searching for folder, gmail, and important as
> regular and completely independent terms (the Z on folder means it's
> stemmed, so it will match folders, foldered, etc.)
thank you very much for your explanation
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-10-01 15:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-29 8:57 Searching from a folder Damien Cassou
2012-09-29 10:58 ` Jani Nikula
2012-09-29 13:17 ` Damien Cassou
2012-09-29 16:12 ` Austin Clements
2012-10-01 9:42 ` Damien Cassou
2012-10-01 12:16 ` Austin Clements
2012-10-01 15:01 ` Damien Cassou
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
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 read-only IMAP folder(s) and NNTP newsgroup(s).