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.
Next fields are required:
id- id of the new crawler, it should contain only alphanumeric symbols, "WorkEmailCrawler" in my case
description- description of the new crawler ("Crawler of email@example.com 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_nameis "mail.nic.ru", "firstname.lastname@example.org" is the
credentials- specify the login and password for the IMAP server,
schedule- specify the cron-style schedule, set
trueto 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.
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.
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.
Search Thorught Your Inbox
To search throught your inbox go to Search page and select your IMAP crawler as 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.
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!