Using MXroute as a Relay for a Mailcow Setup

Running your own mail server with Mailcow is powerful, but outbound deliverability can be challenging especially if you're on a residential connection, cloud provider with restricted port 25, or an IP range with a poor reputation. Using MXroute as an SMTP relay (smarthost) is a simple and reliable way to improve delivery while keeping full control of your Mailcow environment.

In this post, we'll walk through configuring MXroute as a relay for Mailcow step-by-step.


Why Use MXroute as a Relay?

There are a few common reasons to relay outbound mail through MXroute:

  • Your ISP blocks outbound port 25
  • Your server IP has poor reputation or is new
  • You want better deliverability without managing IP warm-up
  • You run Mailcow in a home lab or small VPS
  • You want redundancy for outbound mail
  • 1 less thing to deal with

MXroute handles the heavy lifting of reputation and delivery, while Mailcow continues to manage users, mailboxes, spam filtering, and inbound mail.


Architecture Overview

User / App
    │
    ▼
 Mailcow (Postfix)
    │
    ▼
 MXroute SMTP Relay
    │
    ▼
 Recipient Mail Server

Mailcow remains your primary mail server. MXroute is only used for outbound delivery.


Prerequisites

Before starting, make sure you have:

  • A working Mailcow installation
  • An active MXroute account
  • SMTP credentials from MXroute
  • Outbound connectivity to the MXroute SMTP server (usually port 587)

You will need:

  • SMTP server hostname
  • SMTP username
  • SMTP password
  • SMTP port (typically 587)

Step 1: Get Your MXroute SMTP Credentials

Log into your MXroute control panel and locate:

  • SMTP Server Example:

    fusion.mxrouting.net
  • Username

    user@yourdomain.com
  • Password

  • Port

    587

You will use these values in the Mailcow configuration.


Step 2: Configure Mailcow to Use a Relay Host

Mailcow uses Postfix internally. The easiest way to configure a relay is by setting environment variables in:

mailcow.conf

Add or update the following:

RELAYHOST=mail.yourdomain.com
RELAYHOST_PORT=587
RELAYHOST_USER=user@yourdomain.com
RELAYHOST_PASSWORD=yourpassword

If these variables already exist, just update them.


Step 3: Apply the Configuration

From your Mailcow directory:

docker compose down
docker compose up -d

Or if you want a lighter restart:

docker compose restart postfix-mailcow

Mailcow will regenerate the Postfix configuration automatically.


Step 4: Verify the Relay is Active

Run:

docker compose exec postfix-mailcow postconf relayhost

Expected output:

relayhost = [mail.yourdomain.com]:587

You can also check logs:

docker compose logs -f postfix-mailcow

Look for lines showing authentication to the relay.


Step 5: Send a Test Email

Send a message from:

  • Mailcow webmail
  • SMTP client
  • Application using your Mailcow server

Then verify delivery in the logs:

status=sent
relay=mail.yourdomain.com

If you see the MXroute server listed as the relay target, the configuration is working.


Optional: Restrict Relay Usage by Sender Domain

In some setups, you may want only specific domains to use the relay.

This can be done with Postfix sender-dependent relay configuration, but for most Mailcow deployments, a global relay is sufficient and simpler to maintain.


Troubleshooting

Authentication Failed

Check:

  • Username
  • Password
  • Port
  • TLS requirement

Most MXroute relays require:

STARTTLS
Port 587
Authentication enabled

Mail Still Sending Directly

Common causes:

  • Mailcow not restarted
  • Environment variables not set correctly
  • Typo in hostname
  • Docker container not reloaded

Run:

postconf relayhost

inside the container to confirm.


TLS Errors

If you see certificate errors:

  • Verify system time
  • Ensure outbound firewall allows TLS
  • Check DNS resolution

Security Notes 🔐

  • Always use port 587 with STARTTLS
  • Do not expose SMTP credentials publicly
  • Rotate passwords periodically
  • Restrict firewall access to Mailcow if possible

When This Setup Makes Sense

Using MXroute as a relay is especially useful when:

  • Running Mailcow at home
  • Hosting on small VPS providers
  • Avoiding IP reputation management
  • Sending transactional or low-volume mail
  • Needing reliable outbound delivery quickly

Final Thoughts

Relaying outbound mail through MXroute gives you the best of both worlds:

  • Full control of your mail stack with Mailcow
  • Reliable delivery infrastructure from MXroute

It's a practical setup for homelabs, small infrastructure, and production services where managing mail reputation isn't worth the operational overhead.

Simple, reliable, and production-friendly.