Crawling and Searching Email Inbox With Ambar

In this post we'll discuss how to make your email inbox more valuable by adding advanced search capabilities to it. By the end of the post you will be able to do an instant search throught email messages and it's attacments. All the magic will be done by Ambar - document search engine, so it's required to install it before proceeding (Installation Instructions).


  • Up And Running Ambar CE or EE
  • Email account with access throught IMAP and it's credentials. If you use Gmail and 2-step authentication it's requried to enable IMAP on your account and create application-password. Instructions can be found here.

Setting Up IMAP Crawler

Let's setup Ambar to crawl an email account. Go to the Settings page and create a new crawler by clicking the pink + button in the bottom-right corner.
You'll see the JSON file with a new crawler settings, it looks frightening, but actually it's very simple and comprehensive.

Setup IMAP crawler with Ambar

Next fields are required:

  • id - id of the new crawler, it should contain only alphanumeric symbols, "WorkEmailCrawler" in my case
  • type - imap
  • description - description of the new crawler ("Crawler of inbox")
  • locations - the inbox address for the crawler to crawl. Location should have a host name and the inbox name to be crawled. In my case, host_name is "", "" is the location.
  • credentials - specify the login and password for the IMAP server, auth_type is "basic".
  • schedule - specify the cron-style schedule, set active to true to enable the schedule. I specified to crawl my inbox every hour with */60 * * * * schedule.

All other fileds are optional. Use the image above to help yourself setting it up.

Tap CREATE button. The created crawler will appear in the list. Hit ENQUEUE to start crawling and watch the process.
When Ambar finishes crawling you'll see a yellow "done" line in the logs.

Running Ambar IMAP crawler

When IMAP crawler is adding messages to Ambar, Ambar tries to extract the contents from every messages and it's attachments and does OCR if needed. You can watch the processing state on the Statistics page. As Ambar processes messages they become searchable.

Processing messages with Ambar

Search Thorught Your Inbox

To search throught your inbox go to Search page and select your IMAP crawler as a source.

Selecting a source

Ambar advanced search capabilitites are at your disposal! Search for when:today to show all messages received today. Here you can find detailed Ambar query syntax description.

Search with Ambar throught your inbox

That's it!

Congrats! You've just setted up IMAP crawling with Ambar. Instructions on how to setup other types of crawlers you can find here.

Stay tuned and subscribe for our blog!

Ilya P

Read more posts by this author.

Subscribe to Ambar Blog. How we made your docs searchable

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!