Back to Docs

IMAP Integration

Configure IMAP settings for automated email interactions, such as retrieving 2FA tokens and parsing emails during test execution.

Mechasm supports IMAP integration to facilitate testing scenarios that require email interaction. This is particularly useful for:

  • 2FA/OTP Retrieval: Automatically fetching One-Time Passwords sent via email during sign-up or login flows.

Enabling IMAP Integration

To use these features, you must first enable the integration in your project settings:

  1. Navigate to your Project Settings.
  2. Select the IMAP Integration tab.
  3. Toggle the "Enable IMAP Integration" switch.
mechasm.ai/dashboard/projects/.../settings/imap
IMAP Integration Settings

Configuration

Once enabled, Mechasm requires specific environment variables to connect to your email provider. The settings page will verify if these variables are configured in your project's Env Variables tab.

Required Environment Variables

You must define the following variables:

  • IMAP_USER: The email address or username for the IMAP account.
  • IMAP_PASSWORD: The password or app-specific password for the account.
  • IMAP_HOST: The IMAP server hostname (e.g., imap.gmail.com).

The integration status for each variable will be displayed as either Configured or Missing. Ensure all required variables are set to fully utilize email capabilities in your tests.

Using IMAP During Tests

Once setup is complete, you can use IMAP inside your test flows to retrieve verification codes and continue email-based authentication steps.

See Using Emails in Tests.