On Thu, Jan 18, 2018 at 17:29:38 +0800, Yubin Ruan wrote:
> I know one can hit / or l (i.e., limit) and then apply a search pattern to
> search for messages in the current mailbox. But can we apply this to multiple
> mailboxes? I would like to search for matched messages in all mailboxes and
> then put them into a separate mailbox. For example, I have 10 mailboxes and
> now I want to search in these 10 mailboxes for messages that have me in the
> "To: " field and then put them into a separate mailbox.

I use notmuch for this (using Maildir):

    https://notmuchmail.org/

with these bindings:

    macro index \Cn "\
    <enter-command> set my_wait_key = \$wait_key<enter>\
    <enter-command> unset wait_key<enter>\
    <shell-escape>notmuch-mutt --prompt search<enter>\
    <change-folder-readonly>~/.cache/notmuch/mutt/results<enter>\
    <enter-command> set wait_key = \$my_wait_key<enter>\
    <enter-command> unset my_wait_key<enter>\
    " "search mail (using notmuch)"
    macro index <F9> "\
    <enter-command> set my_wait_key = \$wait_key<enter>\
    <enter-command> unset wait_key<enter>\
    <pipe-message>notmuch-mutt thread<enter>\
    <change-folder-readonly>~/.cache/notmuch/mutt/results<enter>\
    <enter-command> set wait_key = \$my_wait_key<enter>\
    <enter-command> unset my_wait_key<enter>\
    " "search and reconstruct owning thread (using notmuch)"

Notmuch reindexing is triggered by offlineimap, but whatever fetches
email for you should also be able to trigger a reindex.

--Ben

Reply via email to