LinuxCommandLibrary

mairix

TLDR

Index mail folders

$ mairix
copy
Search for subject
$ mairix s:[search term]
copy
Search by sender
$ mairix f:[sender@example.com]
copy
Search by date range
$ mairix d:[1w-]
copy
Combined search
$ mairix s:[report] f:[boss] d:[1m-]
copy
Search body content
$ mairix b:[keyword]
copy

SYNOPSIS

mairix [options] [search-terms...]

DESCRIPTION

mairix is a fast mail indexing and searching tool for Maildir and MH mailboxes. It creates an index database for rapid searching and links matching messages to a results folder.
Search terms use prefixes: s: (subject), f: (from), t: (to), b: (body), d: (date).

PARAMETERS

-f config

Config file path.
-p
Purge results folder.
-F
Force full re-index.
-v
Verbose output.
-Q
Quick (stop at 100 matches).
-t
Include threads.

CONFIGURATION

$ # ~/.mairixrc
base=/home/user/mail
maildir=Maildir
mfolder=search
database=/home/user/.mairix_db
copy

DATE SYNTAX

$ d:1w-      # Last week
d:-2m      # Older than 2 months
d:1y-6m    # Between 1 year and 6 months ago
copy

CAVEATS

Index must be updated after new mail. Results are symlinks. Only Maildir and MH formats. Full reindex needed if database corrupted.

HISTORY

mairix was created by Richard Curnow as a fast alternative to grep-based mail searching.

SEE ALSO

notmuch(1), mu(1), mutt(1), maildir(5)

Copied to clipboard