unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Anderson <MarkR.Anderson@amd.com>
To: Jameson Rollins <jrollins@finestructure.net>,
	"notmuch@notmuchmail.org" <notmuch@notmuchmail.org>
Subject: Re: Strange match to my query
Date: Fri, 25 Feb 2011 13:57:23 -0700	[thread overview]
Message-ID: <3wd8vx3u91o.fsf@testarossa.amd.com> (raw)
In-Reply-To: <878vx4vuxi.fsf@servo.finestructure.net>

On Fri, 25 Feb 2011 12:19:21 -0600, Jameson Rollins <jrollins@finestructure.net> wrote:
> On Tue, 25 Jan 2011 16:29:22 -0700, Mark Anderson <MarkR.Anderson@amd.com> wrote:
> > Apparently matching on email addresses doesn't work the way I hoped.
> > 
> > While debugging why my to:x@y.com search was matching far too many
> > entries, I whittled it down to this:
> > 
> > WORD1=hello
> > WORD2=goodbye
> > MSGID=junk$(date +%s)
> > TESTDIR=$(notmuch config get database.path)/.tmp/new
> > TESTMAIL=$TESTDIR/$MSGID:2,
> > 
> > mkdir -p $TESTDIR
> > 
> > echo Testcase for $WORD1@$WORD2, msgid: $MSGID@junk.com
> > 
> > echo "From: nobody@nobody.com
> > To: c@${WORD1}.com, K-R@${WORD2}.com
> > Date: Mon, 24 Jan 2011 23:41:34 -0600
> > Subject: Error
> > Message-ID: <$MSGID@junk.com>
> > 
> > Not empty body.=
> > 
> > " > $TESTMAIL
> > 
> > notmuch new
> > notmuch search --output=files to:$WORD1@$WORD2
> > notmuch search --output=files to:\"$WORD1@$WORD2\"
> > 
> > Why does that match, but this doesn't?
> > 
> > notmuch search --output=files to:\'$WORD1@$WORD2\'
> 
> Hey, guys.  Reopening an old thread here, found while trying to track
> down a similar problem.
> 
> I'm confused why any of these searches should return anything at all.
> "$WORD1@$WORD2" doesn't actually match either of the addresses in the
> test message, especially when quoted.  The expanded addresses should be:
> 
>   c@hello.com
>   K-R@goodbye.com
> 
> Why should
> 
>   hello@goodbye
> 
> match anything?  And in fact it doesn't for me if I recreate the same
> setup.  Am I missing something?

It shouldn't match anything, that's the value of finding this bug.

What happened is the term counter was reset for each email address, so
the term list for emails in "to:" looks something like this:

0 c      K
1 hello  R
2 com    goodbye
3        com

So it matched a hello at 1 and a goodbye at 2.

I don't remember where the discussion on this went, but it was on the
list.

Perhaps you should search for it, it should take notmuch to
find... *duck*

-Mark

  reply	other threads:[~2011-02-25 20:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25 23:29 Strange match to my query Mark Anderson
2011-01-26  0:51 ` Austin Clements
2011-01-26  2:19   ` Carl Worth
2011-01-26  5:59     ` Carl Worth
2011-01-26 17:02       ` Mark Anderson
2011-02-25 18:19 ` Jameson Rollins
2011-02-25 20:57   ` Mark Anderson [this message]
2011-02-25 21:29     ` Jameson Rollins
2011-03-01 23:00       ` Mark Anderson
2011-03-01 23:15         ` Jameson Rollins
2011-03-01 23:40           ` Mark Anderson
2011-04-14  7:32           ` Florian Friesdorf
2011-04-19  6:21             ` Jameson Graef Rollins

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

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3wd8vx3u91o.fsf@testarossa.amd.com \
    --to=markr.anderson@amd.com \
    --cc=jrollins@finestructure.net \
    --cc=notmuch@notmuchmail.org \
    /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.
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).