Connect Mailcow
Two parts
- BCC map: archives every new message. Required.
- Mailcow API connector: syncs mailboxes as users and aliases as user aliases or groups. With a read-write API key it also imports existing mail. Optional.
1. BCC map
- In EasyMailArchive, open Administration > Integrations.
- On SMTP BCC relay, click Set up.
- Under Your relay address, click Copy.
- In the Mailcow admin panel, go to Configuration > BCC Map.
- Add a BCC map: destination = relay address, type Sender BCC, for all domains.
- Save it in Mailcow.
- Back in EasyMailArchive, open the Mailcow tab and click Done. You see "SMTP BCC source created."
The BCC map needs no IP allowlist.
Test: send a mail and enter its subject in the search bar of your archive.
2. Mailcow API connector
Create the API key in Mailcow
- In the Mailcow admin panel, open System > Configuration > Access, then the API section.
- Choose Read-Write Access to also import existing mail. Read-Only Access only syncs users and aliases.
- In Allow API access from these IPs/CIDR network notations, enter
45.84.197.53(IPv4 only). The Mailcow API card in EasyMailArchive shows the same address. - Activate the API and copy the key.
Save the connector
- In EasyMailArchive, on the Mailcow API card ("Import users, groups and mailboxes from Mailcow"), click Set up.
- Enter API base URL (e.g.
https://mail.example.com) and API key. - Under Domains, add at least one domain.
- Click Test connection, then Save. You see "Mailcow source created. Initial sync started."
What it does
- Creates users from mailboxes. An alias with one recipient becomes a user alias, an alias with several becomes a group.
- Syncs once a day. Sync now on the card starts at once.
- With a read-write key: imports each mailbox's existing mail and checks for new mail about every 15 minutes. For this it creates an app password named
ema-import-…in each mailbox. Do not delete it. - Follow imports under Administration > Import Jobs.
Troubleshooting
| Problem | Fix |
|---|---|
| Test connection fails | Check the API base URL (with https://, no path), the key, and that 45.84.197.53 is in the key's allowed IPs. |
| Users sync, but no mail is imported | The key is read-only. Create a read-write key and set up the connector again. |
| "A mailcow connector already exists. You can only have one per type." | Delete the existing connector on the card first. |
| BCC mail does not arrive | See Setting Up Email Journaling. |