Searching your mail

Fastmail offers a powerful search feature to help you quickly and easily find the messages you need. 

Search for messages by clicking the Search Mail box at the top of your mailbox. You can enter keywords and press the Enter key, or you can choose an option from our search dropdown. The search dropdown will display recent contacts and recent mail searches.

By default, all folders except shared folders, Spam, and Trash will be searched. If you are viewing one of those folders, then only that folder will be searched. If you want your search results to include Spam and Trash, add in:* to the end of your search.

This page offers further information about how to construct powerful searches with syntax.

Advanced search

If you're having trouble finding what you're looking for, you can create a more specific search using our advanced search tool:

  1. Click the Search Mail box at the top of your mailbox.
  2. Select the Advanced search option from the bottom of the dropdown.

This will open a menu that lets you look for keywords in specific places (e.g. the To: or Subject: fields), set the date range you want to search, specify whether the email must be unread or pinned, or have a particular type of attachment.

As a note, the search function does not index punctuation, which means that searching for foo.bar and foo_bar will return the same results. 

Saved searches

After performing a search, the search term appears in the left sidebar. Click the Save button next to the search term to save it, so you can easily search for the same thing later. This is especially helpful if you frequently use search operators to create detailed searches.

Searching by folder or label

By default, all folders will be searched except Spam and Trash. To search a specific folder/label, use the in: operator with the name of the folder/label, e.g. in:sent.

  • in:<foldername> or in:<label>

If a subfolder/sublabel has a unique name, you can use in: with that name directly. Otherwise, you'll need to give the whole path, including parent folders, e.g. in:Mailing Lists/Hiking.

You can search inside a label/folder and all its subfolders/sublabels by adding /* on the end, e.g. in:Mailing Lists/*

If you search in multiple labels, the search results will only show messages that have both of those labels applied to them, not messages with either of the selected labels. To search for messages that have either of the selected labels applied, you will need to use the search term in:"Label 1" OR in:"Label 2".

You can use has:userlabels to search for messages that are in a custom folder or label (i.e. not a system folder such as Inbox, Sent, Drafts, etc.).

Searching for a phrase

  • from:<phrase>
  • to:<phrase> (searches To, Cc and Bcc)
  • tonotcc:<phrase> (searches just To)
  • cc:<phrase>
  • bcc:<phrase>
  • with:<phrase> (searches From, ToCc and Bcc)
  • subject:<phrase>
  • body:<phrase>

Phrases are matched using stemming, which means all different forms of the same word are matched to take into account plurals (fox, foxes) and tenses (fish, fishing, fished). This means, for example, that a search for "bus" will match "buses," but not "business."

If you want to disable stemming and search for an exact word or phrase, surround it in quotes (either ' or "), e.g. "buses" or from:"Joe Bloggs" or subject:'string with "double" quotes'.

If you want to search for quotes or a backslash \, put a backslash before the character: use \", \' and \\.

You can also search for any word that matches a prefix by putting an asterisk (*) on the end, e.g. bus* would match "buses," "business," "bust," etc.

Searching by sender, recipient, or contact

You can search for messages from a specific address by using the from: operator with the email address, e.g. from:joe@example.com.

If you want to find everything from a particular domain, start with the @, e.g. from:@example.com. If you want to include results from a subdomain, exclude the @, e.g. from:example.com.

Similarly, you can search To/Cc/Bcc for an email using the to: operator, e.g. to:jane@example.com.

If you want to search only the To header and not Cc/Bcc, use tonotcc:, e.g. tonotcc:bob@example.com.

You can similarly search Cc/Bcc headers using cc: or bcc: operators. If you want to find messages that were sent to you via a specific address, use the deliveredto: operator, e.g. deliveredto:me@example.com.

If you want to search for only mail that was sent from contacts, or only mail that was sent from members of a particular contact group, you can use fromin: and specify contacts or "Group name", e.g. fromin:contacts or fromin:"Work Pals". You can also search for only mail you've sent to contacts or contact groups using toin:.

Searching by date

By default, searching matches messages regardless of how old they are. If you'd like, you can narrow your search for messages sent on a certain date or date range.

Use date: to search for messages on a specific date. The most common way to use date: is date:year-month-day or date:month-day-year.

Use before: or after: to search for messages before or after certain dates. These operators can be used together to specify date ranges.

Date operators can also be used with d for "day," w for "week," m for "month," or y for "year" instead of specific dates. Examples of this include:

  • date:1y - Find messages from this day one year ago.
  • after:2d - Find messages from within the last 2 days.
  • before:1w - Find messages from before 1 week ago.
  • before:1m after:2m - Find messages that are between 1 month and 2 months old.

Searching in attachments

The search function can find terms inside attachments as well as in file names.

You can search in attachments using attached:<phrase>.

If you want to avoid searching in attachments, you can specify to search the message body only using body:<phrase>.

Searching for attachments

You can find all messages with attachments using has:attachment. To search for a particular file name, use filename:<phrase>.

Attachments of particular type can be found with the filetype:<type> operator. You can specify a MIME type, or one of the following special values:

  • image
  • document
  • spreadsheet
  • presentation
  • PDF
  • calendar

Some systems may generate emails with attachments with the wrong or "missing" MIME types, in which case the search may fail to find the expected emails.

Searching by message list

You can search for messages from a particular list-id using list:foo.example.com.

If you would like to search for a partial string match, adding an asterisk at the end of your search will not return results like when searching for a partial phrase. Instead, you will need to use header:list-id:substring. This will return results for any list-id that matches that particular substring.

Searching other headers

You can search for the existence of a particular header using header:"<headername>". Please note that quotes will need to be used.

You can also search for messages that include a particular string of text within the header using header:"<headername>:<text>".

Searching for a specific ID

If you know the message id you are searching for, you can use the msgid:<id> operator to find it directly.

Searching by message size

  • smaller|maxsize:<size>
  • bigger|larger|minsize:<size>

A size is specified in bytes, with an optional suffix k, m, or g, e.g. larger:10m.

Combining searches

Operators to join search terms must be uppercase.

  • AND — both search terms must be present in the message. (This is used by default.)
  • OR — e.g. from:rob OR from:richard.
  • NOT — the term that follows is excluded from search results. For example, since:"1 week ago" from:rob NOT subject:"new web interface" would find any messages from Rob in the last week where the subject line does not contain the words "new web interface".
  • () — grouping, e.g. (from:rob subject:"new web interface") OR subject:urgent. This finds any messages from Rob with "new web interface" in the subject line, as well as messages from anyone with the subject "urgent". Grouping can also be used to create searches that have both AND and OR in the search conditions, e.g. (from:rob OR from:jeff) AND (subject:urgent OR subject:important). This will find any messages from Rob or Jeff with either the subject "urgent" or "important".

You can also substitute the characters + and - for AND and NOT, respectively. In this case, -subject:"Flight" will return all messages where the subject does not contain the word "flight".

Searching by message state

  • has|is:<boolean>
  • filetype:image|document|spreadsheet|presentation|pdf|calendar
  • flag:<flag name>

The following states can be specified with the is keyword:

  • read or seen
  • unread or unseen
  • pinned or flagged
  • unpinned or unflagged
  • replied or answered
  • unreplied or unanswered
  • draft
  • undraft
  • muted

The following states can be specified with the has keyword:

  • attachment or att
  • noattachment or noatt

For backwards compatibility, we also support writing a term in UPPERCASE without the has or is keyword prefix. For example, the searches UNSEEN or is:unread are the same, and will both show all unread messages.

The filetype keyword finds emails with attachments of the given type. It does this by looking at the MIME type of the attachments. Some systems may generate emails with attachments with the wrong or "missing" MIME types, in which case the search may fail to find the expected emails.

You can search for a specific IMAP keyword using keyword:<keyword name>.

The flag: search refers to IMAP flags, for example "pinned" or "read". Since we already offer search terms for pinned and read, the flag: search is intended for users who set their own custom flags via IMAP.

Searching for contact mail

If you want to search for mail from contacts, or even members of a particular contact group, you can use the fromin: operator. For messages sent to contacts, you can use the toin: operator.

Searching by priority

If you want to search for messages marked as high priority by the sender, you can use the priority:high operator.

Making a rule from search

Want to move all messages from a search to a folder, mark them as read, or pin them? You can - by making a rule from search.

To take make a rule for emails meeting a search term, click on the Create rule button to the right of the search box. This will pull up our rules creation menu, so you can quickly build a rule based on your search query.

For more information on rules, take a look at Organizing your inbox with rules.

Can I search using regex?

We support regular expressions for incoming rules, but not for searching. Fastmail uses indexing to make searching your mail fast, and we're unable to evaluate a regular expression against the index. To support regular expressions, we'd be loading each message in your account, which would be too slow to be usable. Instead please use the search operators listed above, or contact our support team for help with your search.

Was this article helpful?
96 out of 129 found this helpful