Searching with prefix :folder and --output=files

Nathan Clapham nathan at claphams.info
Tue Jun 11 14:34:24 PDT 2013


Hi Everyone, 

Thanks for notmuch mail, it is a great program!

I am having an issue searching with --output=files and the folder prefix.

Could you please tell me if I've misunderstood something or perhaps there is 
something wrong with my setup. Details of 2 examples below:

$ notmuch --version
notmuch 0.15.2

----
1. Archive folder

Archive message #: 1356
Directory: $HOME/Mail/Gmail/[Gmail].Archive

$ notmuch count folder:Archive
1356

$ notmuch search --output=messages folder:Archive | wc -l
1356

$ notmuch search --output=files folder:Archive | wc -l
1572

I wondered why I was getting more files listed in the last example. It turns out 
some files are included from other folders. For example:

Mail/Gmail/[Gmail].Sent Mail/cur/137075610...28e65ad90fc4f:2,S

If I then do this:

$ notmuch search --output=files folder:Archive | grep Archive | wc -l
1356

I get the correct count again.

Different folders have a similar issue:

2. INBOX folder

INBOX message #: 87
Directory: $HOME/Mail/Gmail/INBOX

$ notmuch count folder:INBOX
87

$ notmuch search --output=messages folder:INBOX | wc -l
87

$ notmuch search --output=files folder:INBOX | wc -l
97

This time some messages from Archive are included:

Mail/Gmail/[Gmail].Archive/cur/137077654...d7c877e152f72dd5ddbc11f:2,S

$ notmuch search --output=files folder:INBOX | grep INBOX | wc -l
87
----

I think this illustrates the problem I'm having. Maybe I don't understand how 
the folder: prefix works? Perhaps it is my folder structure - the inclusion of 
the imap prefix [Gmail].?? It seems the search is matching the correct messages 
though, but the output of files includes messages from another folder. 

Any advice would be appreciated.

Thanks,
Nathan.



More information about the notmuch mailing list