Re: Searching for an Exact Email Address

Subject: Re: Searching for an Exact Email Address

Date: Sun, 02 Feb 2020 08:12:50 +0200

To: Kevin Foley, notmuch@notmuchmail.org

Cc:

From: Teemu Likonen


Kevin Foley [2020-02-01T16:29:25-05] wrote:

> I'm getting unexpected results when trying to search for messages
> associated with an email address.

> $ notmuch search to:"example@email.com"

> My understanding is this should be treated as a phrase which means
> that exact phrase will be searched for, is this correct?

Double quotes are special characters in your shell and it interprets
them so that notmuch doesn't get them. There are different ways in shell
to escape special characters:

    to:\"example@email.com\"
    'to:"example@email.com"'

The shell built-in "set" is useful for testing parameters:

    $ set -- to:"example@email.com" to:\"example@email.com\"
    $ printf '%s\n' "$@"
    to:example@email.com
    to:"example@email.com"

-- 
///  OpenPGP key: 4E1055DC84E9DFF613D78557719D69D324539450
//  https://keys.openpgp.org/search?q=tlikonen@iki.fi
/  https://keybase.io/tlikonen  https://github.com/tlikonen
signature.asc (application/pgp-signature)
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: