Bika
GuideAutomation

How to trigger automation upon receiving an email?

Learn how to trigger automation using IMAP when a new email arrives. Step-by-step setup for IMAP integration, inbox monitoring, filters, and attachment handling in Bika.ai.

How to trigger automation upon receiving an email?

What is IMAP?

IMAP (Internet Message Access Protocol) is a protocol used to retrieve emails from a mail server. Unlike POP3, IMAP allows emails to be stored on the server and accessed from multiple devices simultaneously.

Key features of IMAP include:

  • Multi-device synchronization: Emails remain stored on the server and can be accessed through multiple clients.
  • Remote management: Supports marking emails as read, deleted, or archived directly on the server.
  • Partial download: Allows previewing email content without downloading the entire email.

How to Use IMAP in Automation

In Bika.ai automation, you can use the Inbound Email trigger to initiate an automation workflow whenever the target email account receives an email.

Inbound Email trigger in automation

Adding an IMAP Integration

In the trigger configuration, you must first select an IMAP integration. If you have already set up an integration in the Space Station settings, you can directly select and use it. If not, you can connect your email account here.

Select IMAP integration

How to Configure IMAP Integration

Click Create Integration, and a popup window will appear for configuring IMAP. Several parameters need to be set. Below are common IMAP configuration options and their meanings:

  • MAP Server (IMAP Server Address) Specifies the mail server address used to receive emails. This is typically the IMAP server domain of the email provider. Examples include:

    • Gmail: imap.gmail.com
    • Outlook: outlook.office365.com
    • Yahoo: imap.mail.yahoo.com
    • QQ Mail: imap.qq.com
  • Port (Port Number) Specifies the network port for the IMAP server. Common port numbers include:

    • 993 (default, SSL/TLS encryption)
    • 143 (STARTTLS encryption, less commonly used) Modern email services typically recommend using port 993 for security.
  • Username The login name for the email account, usually the full email address (e.g. yourname@gmail.com).

  • Password (Password or Authorization Code) The credentials required to access the mail server. Some email services (such as Gmail, Outlook, and QQ Mail) require an app-specific password or authorization code instead of the regular account password.

IMAP integration configuration

Gmail Configuration Example

Gmail IMAP configuration example
  • IMAP Service: Use imap.gmail.com
  • Port Number: Default is 993, no changes needed
  • Username: Your Gmail email address
  • Password: Use an app-specific password from your Google account

Gmail no longer supports simple password authentication. You must first create an app-specific password for IMAP authentication. To do this, go to Google Account Security, enable 2-Step Verification, then create an app password at the bottom of the page. Copy and paste this app password into the IMAP integration password field.

Google account security settings Create app password in Google account

Monitoring the Inbox Folder

Once the IMAP integration is successfully added, you can retrieve the list of email folders in the Folder Menu. The default selection is the Inbox.

You can specify which folder to monitor. Emails received in other folders will not trigger automation.

Select folder to monitor

Custom Email Retrieval Rules

If you only want to trigger automation for specific emails, you can add retrieval rules using node-imap syntax to precisely filter emails. Examples include:

  • Retrieve only unread emails: ['UNSEEN']
  • Emails with subject containing "hello" and sent from ana@gmail.com: [['SUBJECT', 'hello'], ['FROM', 'ana@gmail.com']]
  • Unread emails received after April 20, 2024: ['UNSEEN', ['SINCE', 'April 20, 2024']]
Custom email retrieval rules

Downloading Attachments

When Download Attachments is enabled, email attachments will be saved. You can select them later in the workflow using the Variable Selector.

Running a Test

After completing the configuration, click Run Test. This will fetch an email and display the result, confirming that the trigger is set up correctly. You can then proceed to add the required automation steps.

After completing all automation settings, remember to enable automation. Once enabled, the automation will trigger automatically upon receiving an email.

Run test for inbound email trigger
Recommend AI Automation Templates
AI Automated Task Management
AI Automated Task Management
Helps teams efficiently manage weekly tasks. Through a series of automation tools, including task summaries, progress reminders, and personal summary reports, team members can promptly obtain task information and progress, thereby improving collaboration efficiency and work transparency. By using these automation features, teams can maintain efficient operations and ensure that each member has a clear understanding and sense of responsibility for their tasks.
Content Marketing for SEO
Content Marketing for SEO
Use the Content Marketing for SEO template as a powerful content strategy template to streamline SEO content management and content workflow management from idea to publication. This content marketing automation setup helps you align content with SEO keywords, manage personas for persona based marketing, and track every step in a visual content marketing dashboard and content performance dashboard. Improve online visibility by organizing topics, workflows, and campaigns in one place so your team can plan, produce, and optimize SEO content more efficiently.
AI Sales Report
AI Sales Report
The AI Sales Report template turns raw sales data analysis into automated sales reporting and a clear weekly sales report for every store. Use AI sales analytics and AI retail analytics to run sales performance analysis, sales performance monitoring, and sales trend analysis across locations. It works like AI business intelligence for retail teams, supporting business analyst reporting, automated report delivery, and trend analysis for sales so managers and analysts can make faster, data‑driven decisions without manual reporting.
Fully Automated Twitter Scheduler
Fully Automated Twitter Scheduler
Automate your Twitter (X) account with Bika.ai's AI-powered template. Schedule tweets, post automatically, and save time while keeping your account active 24/7. Perfect for social media managers, businesses, and influencers.
Lead Notification Automation and AI-Driven Strategies
Lead Notification Automation and AI-Driven Strategies
Use the Lead Notification Automation and AI-Driven Strategies template as a lead management template that connects your lead capture form and lead intake form to fully automated lead follow up. When a new client submits information, triggers and rules route the lead into your MQL database, AI generates follow‑up suggestions, and email plus Slack notifications are sent automatically. This reduces response times, supports consistent follow‑up from sales and support teams, and drives customer satisfaction improvement by ensuring every lead is acknowledged and handled promptly.
AI VAT Invoice Information Recognition (China)
AI VAT Invoice Information Recognition (China)
This AI VAT Invoice Information Recognition (China) template uses Baidu AI Cloud to deliver AI invoice extraction and end‑to‑end invoice workflow automation for Chinese VAT invoices. Automatically recognize key fields, verify invoices, and write results into your database to streamline financial data management. Support supplier invoice processing and purchase order invoices in the same flow, reducing manual input, lowering error rates, and helping finance teams, SMEs, accountants, and procurement departments keep VAT invoice records accurate, searchable, and audit‑ready.