Skip to content

Integrate Mailpiler in mailcow

This guide describes the integration of Mailpiler in mailcow for email archiving.

Prerequisites

  • A working mailcow installation
  • A working Mailpiler installation
  • Administrator access to both systems

Step 1: Create Dummy Target in Transport Maps

Important

The dummy target entry created in this step will be used in the following steps to configure the BCC rules. This dummy mailbox does not need to exist, as it only serves to forward emails to the Mailpiler server.

This step only needs to be performed once per mailcow installation, regardless of the number of domains or mailboxes to be archived.

First, a dummy target must be configured in the Postfix transport maps to forward emails to Mailpiler.

  1. Log in to the mailcow administration interface
  2. Navigate to System > Configuration > Routing > Transport Maps
  3. Create a new transport entry:
    • Destination: archive.mailcow.local
    • Next Hop: [mailpiler-host]:25 (IP address or hostname of your Mailpiler server)

Step 2: Activate BCC Rules

Important

Make sure that the Mailpiler server is configured to accept emails from your mailcow server. For Mailpiler instances hosted by us, this is the default setting.

Also note that there can only be one BCC rule for incoming and one for outgoing emails per domain (or mailbox). If you have already configured other BCC rules, they must be removed or adjusted.

If the BCC rules are not set, no emails will be forwarded to Mailpiler for archiving.

Recipient-dependent BCC Rule

Configure a BCC rule for incoming emails:

  1. Navigate to Email > Configuration > Address Rewriting > BCC Maps
  2. Click Add BCC Entry
  3. Configure the rule:
    • Local Destination: the domain present in mailcow, e.g. your-domain.com
    • BCC Type: Recipient-dependent (incoming emails to the mailcow server)
    • BCC Destination: archive@archive.mailcow.local (dummy target from step 1 connected to a dummy mailbox, this only serves for forwarding and does not need to exist)
    • Active: ✓

Tip

You can also configure specific email addresses instead of the entire domain by entering the corresponding addresses in the Local Destination field, not recommended if you want to archive all emails.

Sender-dependent Domain Rule

Configure a BCC rule for outgoing emails:

  1. Navigate to Email > Configuration > Address Rewriting > BCC Maps
  2. Click Add BCC Entry
  3. Configure the rule:
    • Local Destination: the domain present in mailcow, e.g. your-domain.com
    • BCC Type: Sender-dependent (outgoing emails from the mailcow server)
    • BCC Destination: archive@archive.mailcow.local (dummy target from step 1 connected to a dummy mailbox, this only serves for forwarding and does not need to exist)
    • Active: ✓

Tip

You can also configure specific email addresses instead of the entire domain by entering the corresponding addresses in the Local Destination field, not recommended if you want to archive all emails.

Step 3: Test Configuration

Send test emails to verify archiving:

  1. Send an email to an address in your domain
  2. Send an email from an address in your domain
  3. Check in Mailpiler whether both emails have been archived

Notes

  • All emails are blind copied (BCC), the original recipients do not see the archiving
  • If Mailpiler is not reachable, emails will still be delivered, the BCC copy will remain in the email queue until Mailpiler is reachable again