On Tue, 25 Jan 2011 16:29:22 -0700, Mark Anderson 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? jamie.