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

  1. In EasyMailArchive, open Administration > Integrations.
  2. On SMTP BCC relay, click Set up.
  3. Under Your relay address, click Copy.
  4. In the Mailcow admin panel, go to Configuration > BCC Map.
  5. Add a BCC map: destination = relay address, type Sender BCC, for all domains.
  6. Save it in Mailcow.
  7. 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

  1. In the Mailcow admin panel, open System > Configuration > Access, then the API section.
  2. Choose Read-Write Access to also import existing mail. Read-Only Access only syncs users and aliases.
  3. 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.
  4. Activate the API and copy the key.

Save the connector

  1. In EasyMailArchive, on the Mailcow API card ("Import users, groups and mailboxes from Mailcow"), click Set up.
  2. Enter API base URL (e.g. https://mail.example.com) and API key.
  3. Under Domains, add at least one domain.
  4. 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

ProblemFix
Test connection failsCheck 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 importedThe 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 arriveSee Setting Up Email Journaling.