Connect Mailcow
Overview
Mailcow uses three separate parts:
- BCC map: Archives all new email continuously. This is the way to archive on an ongoing basis.
- Mailcow API: Syncs mailboxes as users and aliases as user aliases or groups. It does not import email.
- IMAP mailboxes: Pull existing email once.
1. Continuous archiving with a BCC map
- Open Admin > Integrations in EasyMailArchive.
- On SMTP BCC relay, click Set up.
- Under Your relay address, copy
{slug}-{token}@smtp.easymailarchive.com. The part after the hyphen is a token that differs for each tenant. Addresses without the token stop working after a short grace period. - Open the Mailcow admin panel and go to Configuration, then the BCC maps.
- Add a new BCC map. Enter the relay address as destination. Choose Sender BCC as type. Apply it to all domains.
- Save the map in Mailcow.
- Go back to the SMTP BCC relay setup dialog, open the Mailcow tab and click Done.
The source is saved when SMTP BCC source created. appears.
Then check that the first email arrived. Send a test mail and look for its subject under Search. On Admin > Dashboard, the Compliance status card then shows Active, {count} emails archived.
2. Users and aliases with the Mailcow API
- Open the Mailcow web interface as administrator.
- In the configuration, in the access area (Access, API), create an API key. A read-only key is enough. Copy the key.
- In EasyMailArchive, open Admin > Integrations and the Mailcow API card.
- Enter:
- API base URL, for example
https://mail.example.com - API key
- Domains, at least one
- API base URL, for example
- Click Test connection.
- Click Save.
The sync runs hourly. An alias with one recipient becomes a user alias, an alias with several recipients becomes a group.
3. Importing existing email
The Mailcow API does not fetch existing email. Add each mailbox as an IMAP mailbox instead:
- Open Admin > Integrations and the IMAP mailboxes card.
- Click Add mailbox.
- Enter Server, Username and Password. Use IMAP over SSL on port 993.
- Under Assign emails to, pick the matching user or a group.
- Click Test connection, then Add mailbox.
The import reads all folders and skips messages that are already archived. Email that arrives after the import is only fetched when you click Sync now again. The BCC map from step 1 handles ongoing archiving.
See also: Setting up email journaling.