Setting up Relay for your domain
Setting up Relay takes about 5 minutes. You'll add your domain, configure your mail server as the destination, add relay addresses, and update your MX records.
Prerequisites
- A Cleanbox account on the Advanced or Enterprise plan
- A domain you own with access to DNS settings
- Your current mail server hostname or IP address (where email should be delivered after filtering)
Step 1: Add and verify your domain
If you haven't already added your domain to Cleanbox, follow the domain setup guide first. You'll need the domain to be verified before you can enable Relay.
If your domain is already added and verified, proceed to Step 2.
Step 2: Enable Relay on your domain
- Navigate to Domains in the sidebar
- Click on your domain
- Go to the Relay tab
- Click "Enable Relay"
Step 3: Configure your SMTP destination
Tell Cleanbox where to forward clean messages. This is your existing mail server — where email was delivered before Relay.
- SMTP host — Your mail server's hostname or IP address (e.g.,
mail.yourdomain.comor203.0.113.10) - SMTP port — Usually 25 for server-to-server delivery
Note: If your current email is hosted by Gmail (Google Workspace) or Outlook (Microsoft 365), your SMTP destination would be their MX servers. However, these providers may reject forwarded mail in some configurations. Test thoroughly before switching MX records.
Step 4: Add relay addresses
Specify which email addresses on your domain should be protected by Relay:
- Click "Add address"
- Enter the email address (e.g.,
info@yourdomain.com) - Optionally set a custom spam threshold for this address
- Click "Save"
Repeat for each address you want to protect. Only listed addresses are filtered — unlisted addresses are still forwarded to your mail server but without Cleanbox filtering.
Step 5: Test your setup
Before changing your MX records (which affects all live email), test the relay connection:
- On the Relay settings page, click "Test relay"
- Cleanbox will attempt to connect to your SMTP destination
- If successful, you'll see a confirmation
- If it fails, check your SMTP hostname, port, and firewall settings
Step 6: Update your MX records
Once testing is successful, update your domain's MX records to point to Cleanbox:
| Type | Name | Value | Priority |
|---|---|---|---|
| MX | @ |
mx1.cleanbox.to |
10 |
Important: Remove your old MX records (or set them to a lower priority) so that all email flows through Cleanbox. If you keep the old records with equal or higher priority, some email will bypass Relay entirely.
DNS propagation typically takes 5–30 minutes. During propagation, some emails may still arrive directly at your old server — this is normal and temporary.
Relay tokens
Each relay address has a unique token used for authentication between Cleanbox and your mail server. Tokens are generated automatically when you add an address.
If you suspect a token has been compromised, you can regenerate it from the address settings. After regenerating, the old token is immediately invalidated.
Troubleshooting
"Connection refused" during test
- Verify your SMTP host and port are correct
- Check that your firewall allows incoming connections on port 25 from Cleanbox IP ranges
- Ensure your mail server is running and accepting connections
"Relay rejected" errors
- Your mail server may not accept email for the domain from an unknown source. Add Cleanbox's IP addresses to your server's allowed relay list.
Email is still arriving directly (bypassing Relay)
- Check that your old MX records have been removed or lowered in priority
- Verify DNS propagation is complete:
dig MX yourdomain.com +short - Some senders cache MX records — give it up to 48 hours for full propagation