Searching your mail

To find a message, type one or more keywords into the Search Mail box at the top of your mailbox, and hit Enter.

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

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 on the search bar at the top of the page.
  2. Select the Advanced search… option from the menu that appears.

This will open a pop-up 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.

Saved searches

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

Searching by folder or label

  • in:<foldername> or in:<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.

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/*.

Searching for a phrase

  • from:<phrase>
  • to:<phrase> (searches To, Cc and Bcc)
  • tonotcc:<phrase> (searches just To)
  • cc:<phrase>
  • bcc:<phrase>
  • subject:<phrase>
  • body:<phrase>
  • list:<phrase> (searches the List-Id header)

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 alias, 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". 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.

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.

Searching other headers

You can search for the existence of a particular header using header:<headername>.

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 — doesn't do anything, since this is the default.
  • OR — e.g. from:rob OR from:richard.
  • NOT — applies to the term it comes before. For example, since:"1 week ago" from:rob NOT subject:"new web interface" would find any messages from Rob in the last week that are not about the "new web interface".
  • () — grouping, e.g. (from:rob subject:"new web interface") OR subject:urgent. This finds any mail from Rob with "new web interface" in the subject line, as well as mail from anyone with the subject "urgent".

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

Searching by message state

  • has|is:<boolean>
  • filetype:image|document|spreadsheet|presentation|pdf
  • 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

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 in 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 keyboard using keyword:<keyword name>.

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?
49 out of 70 found this helpful