docs: create Netgrimoire/Services/MailCow/Sample_Domain_Setup
This commit is contained in:
parent
973efdb2e3
commit
3738f8f0fb
1 changed files with 298 additions and 0 deletions
298
Netgrimoire/Services/MailCow/Sample_Domain_Setup.md
Normal file
298
Netgrimoire/Services/MailCow/Sample_Domain_Setup.md
Normal file
|
|
@ -0,0 +1,298 @@
|
|||
---
|
||||
title: Sample Domain Setup
|
||||
description: Graymutt@nucking-futz.com
|
||||
published: true
|
||||
date: 2026-02-25T22:02:27.719Z
|
||||
tags:
|
||||
editor: markdown
|
||||
dateCreated: 2026-02-25T22:02:27.719Z
|
||||
---
|
||||
|
||||
# Mail Setup — nucking-futz.com
|
||||
|
||||
## Overview
|
||||
|
||||
This guide covers complete mail setup for `nucking-futz.com` using MXRoute as the inbound gateway and Mailcow as the mailbox host. MXRoute receives all inbound mail from the internet (solving residential IP filtering issues with banks and financial institutions) and forwards to Mailcow for storage and retrieval. Mailcow handles outbound mail via the MXRoute SMTP relay.
|
||||
|
||||
**Architecture:**
|
||||
|
||||
```
|
||||
Inbound: Internet → MXRoute (commercial IP) → Mailcow (192.168.5.16)
|
||||
Outbound: Mailcow → MXRoute SMTP relay → Internet
|
||||
```
|
||||
|
||||
**Why two domains in Mailcow:**
|
||||
MXRoute forwarders require a valid destination email address. You cannot forward `graymutt@nucking-futz.com` back to `graymutt@nucking-futz.com` — that loops. The solution is to have Mailcow own a subdomain (`mail.nucking-futz.com`) with its own MX record pointing directly to your server. MXRoute forwards to `graymutt@mail.nucking-futz.com`, Mailcow delivers locally, and an alias domain maps `nucking-futz.com` back so users only ever see and use `graymutt@nucking-futz.com`.
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- MXRoute account active with DirectAdmin access
|
||||
- Mailcow running at 192.168.5.16
|
||||
- DNS management access for nucking-futz.com
|
||||
- Your MXRoute server hostname from your MXRoute welcome email (e.g. `arrow.mxrouting.net`)
|
||||
|
||||
---
|
||||
|
||||
## Step 1 — DNS Records
|
||||
|
||||
Create all DNS records before configuring either service. Keep TTL at 300 during setup — raise to 3600 once confirmed working.
|
||||
|
||||
### Required DNS Records
|
||||
|
||||
| Type | Host | Value | Notes |
|
||||
|------|------|-------|-------|
|
||||
| A | `mail` | `YOUR_ATT_MAIL_IP` | Points to Mailcow — MXRoute forwards to this server |
|
||||
| MX | `@` | `YOUR_MXROUTE_SERVER` (priority 10) | Check MXRoute welcome email for exact hostname |
|
||||
| MX | `@` | `YOUR_MXROUTE_RELAY` (priority 20) | Secondary MXRoute server from welcome email |
|
||||
| MX | `mail` | `mail.nucking-futz.com` (priority 10) | Mailcow handles this subdomain directly |
|
||||
| CNAME | `imap` | `mail.nucking-futz.com` | Client autoconfiguration |
|
||||
| CNAME | `smtp` | `mail.nucking-futz.com` | Client autoconfiguration |
|
||||
| CNAME | `webmail` | `mail.nucking-futz.com` | Roundcube access |
|
||||
| CNAME | `autodiscover` | `mail.nucking-futz.com` | Outlook autodiscover |
|
||||
| CNAME | `autoconfig` | `mail.nucking-futz.com` | Thunderbird autoconfig |
|
||||
| TXT | `@` | `v=spf1 ip4:YOUR_ATT_MAIL_IP include:mxroute.com -all` | SPF — authorizes both Mailcow direct and MXRoute relay |
|
||||
| TXT | `mail` | `v=spf1 ip4:YOUR_ATT_MAIL_IP -all` | SPF for subdomain — Mailcow sends directly from here |
|
||||
| TXT | `_dmarc` | `v=DMARC1; p=reject; rua=mailto:admin@netgrimoire.com` | DMARC enforcement |
|
||||
|
||||
> DKIM TXT records (two selectors) are added in Steps 2 and 3 after generating keys in Mailcow and MXRoute.
|
||||
|
||||
---
|
||||
|
||||
## Step 2 — Mailcow Configuration
|
||||
|
||||
### 2.1 Add the Subdomain as Primary Domain
|
||||
|
||||
Mailcow owns `mail.nucking-futz.com` as its active mail domain. Mailboxes live internally on this subdomain.
|
||||
|
||||
1. Log into Mailcow admin UI → **Mail Setup → Domains**
|
||||
2. Click **Add domain**
|
||||
3. Set **Domain:** `mail.nucking-futz.com`
|
||||
4. Leave all other settings as default
|
||||
5. Click **Add domain**
|
||||
|
||||
### 2.2 Add the Alias Domain
|
||||
|
||||
This makes Mailcow accept mail addressed to `@nucking-futz.com` and deliver it to the matching `@mail.nucking-futz.com` mailbox. Users send and receive as `@nucking-futz.com` — the subdomain is invisible to them.
|
||||
|
||||
1. Go to **Mail Setup → Alias Domains**
|
||||
2. Click **Add alias domain**
|
||||
3. Set **Alias Domain:** `nucking-futz.com`
|
||||
4. Set **Target Domain:** `mail.nucking-futz.com`
|
||||
5. Click **Add**
|
||||
|
||||
### 2.3 Create Mailbox
|
||||
|
||||
1. Go to **Mail Setup → Mailboxes**
|
||||
2. Click **Add mailbox**
|
||||
3. Set **Username:** `graymutt`
|
||||
4. Set **Domain:** `mail.nucking-futz.com`
|
||||
5. Set a strong password
|
||||
6. Set quota as needed
|
||||
7. Click **Add**
|
||||
|
||||
The mailbox is internally `graymutt@mail.nucking-futz.com`. The alias domain from Step 2.2 means Mailcow also accepts and delivers mail for `graymutt@nucking-futz.com` to this same mailbox.
|
||||
|
||||
### 2.4 Generate DKIM Key
|
||||
|
||||
1. Go to **Configuration → Configuration & Diagnostics → Configuration**
|
||||
2. Click **ARC/DKIM Keys** tab
|
||||
3. Select domain `mail.nucking-futz.com`
|
||||
4. Set **Selector:** `mailcow`
|
||||
5. Set **Key length:** 2048
|
||||
6. Click **Generate**
|
||||
7. Copy the full TXT record value — needed for DNS
|
||||
|
||||
### 2.5 Add Mailcow DKIM DNS Record
|
||||
|
||||
| Type | Host | Value |
|
||||
|------|------|-------|
|
||||
| TXT | `mailcow._domainkey.mail` | *(full key string from Mailcow — begins with `v=DKIM1;`)* |
|
||||
|
||||
### 2.6 Add MXRoute to Trusted Networks
|
||||
|
||||
Prevents Mailcow from applying spam scoring to forwarded mail arriving from MXRoute's IPs.
|
||||
|
||||
1. Go to **Configuration → Configuration & Diagnostics → Configuration**
|
||||
2. Click **Extra Postfix configuration** tab
|
||||
3. Add to `extra.cf`:
|
||||
|
||||
```
|
||||
# Trust MXRoute forwarding IPs
|
||||
mynetworks = 127.0.0.1/8 [::1]/128 192.168.5.0/24 69.167.160.0/19 198.54.120.0/22
|
||||
```
|
||||
|
||||
> Verify current MXRoute IP ranges in your MXRoute account documentation — these may change.
|
||||
|
||||
4. Click **Save**
|
||||
5. Click **Restart affected containers**
|
||||
|
||||
### 2.7 Configure Outbound Relay
|
||||
|
||||
Routes outbound mail through MXRoute for best deliverability.
|
||||
|
||||
1. Go to **Configuration → Routing → Sender-Dependent Transports**
|
||||
2. Click **Add transport**
|
||||
3. Set **Domain:** `nucking-futz.com`
|
||||
4. Set **Relay host:** `[smtp.mxroute.com]:587` (confirm SMTP hostname from MXRoute welcome email)
|
||||
5. Set **Username:** your MXRoute relay username
|
||||
6. Set **Password:** your MXRoute relay password
|
||||
7. Click **Add**
|
||||
8. Repeat for domain `mail.nucking-futz.com` using the same relay credentials
|
||||
|
||||
---
|
||||
|
||||
## Step 3 — MXRoute Configuration
|
||||
|
||||
### 3.1 Add Domain in DirectAdmin
|
||||
|
||||
1. Log into MXRoute DirectAdmin
|
||||
2. Go to **Account Manager → Domain Setup**
|
||||
3. Add domain: `nucking-futz.com`
|
||||
4. Complete the domain wizard
|
||||
|
||||
### 3.2 Create Forwarder
|
||||
|
||||
MXRoute does not support domain-level remote MX routing — forwarders must be created per address. The destination must be on a domain whose MX resolves to Mailcow, not back to MXRoute.
|
||||
|
||||
1. Go to **Forwarders** in the MXRoute control panel
|
||||
2. Click **Create New Forwarder**
|
||||
3. Set **Forwarder Name:** `graymutt` (the `@nucking-futz.com` part is shown automatically)
|
||||
4. Set **Destination Type:** `Forward to Email(s)`
|
||||
5. Set **Recipients:** `graymutt@mail.nucking-futz.com`
|
||||
6. Click **Create Forwarder**
|
||||
|
||||
> Every new mailbox requires a matching forwarder entry. The pattern is always `user@nucking-futz.com` → `user@mail.nucking-futz.com`. See the Adding a New Mailbox section below.
|
||||
|
||||
### 3.3 Get MXRoute DKIM Key
|
||||
|
||||
1. Go to **Email Manager → DKIM Keys** for `nucking-futz.com`
|
||||
2. Generate or view the DKIM key — note the selector name assigned (often `x`)
|
||||
3. Copy the full TXT record value
|
||||
|
||||
### 3.4 Add MXRoute DKIM DNS Record
|
||||
|
||||
| Type | Host | Value |
|
||||
|------|------|-------|
|
||||
| TXT | `x._domainkey` *(replace `x` with MXRoute's actual selector)* | *(full key string from MXRoute DirectAdmin)* |
|
||||
|
||||
---
|
||||
|
||||
## Step 4 — Verify DNS
|
||||
|
||||
Once DNS has propagated, verify all records:
|
||||
|
||||
```bash
|
||||
# MX for main domain — should show MXRoute servers
|
||||
dig MX nucking-futz.com +short
|
||||
|
||||
# MX for subdomain — should show mail.nucking-futz.com
|
||||
dig MX mail.nucking-futz.com +short
|
||||
|
||||
# A record — should show your ATT IP
|
||||
dig A mail.nucking-futz.com +short
|
||||
|
||||
# SPF
|
||||
dig TXT nucking-futz.com +short
|
||||
dig TXT mail.nucking-futz.com +short
|
||||
|
||||
# DMARC
|
||||
dig TXT _dmarc.nucking-futz.com +short
|
||||
|
||||
# DKIM — Mailcow
|
||||
dig TXT mailcow._domainkey.mail.nucking-futz.com +short
|
||||
|
||||
# DKIM — MXRoute (replace x with your selector)
|
||||
dig TXT x._domainkey.nucking-futz.com +short
|
||||
```
|
||||
|
||||
Run a full check at [https://mxtoolbox.com](https://mxtoolbox.com) → Email Health for `nucking-futz.com`.
|
||||
|
||||
---
|
||||
|
||||
## Step 5 — Test Mail Flow
|
||||
|
||||
### Inbound Test
|
||||
|
||||
Send a test email to `graymutt@nucking-futz.com` from an external Gmail or Outlook account. Verify:
|
||||
|
||||
- Mail arrives in the Mailcow mailbox
|
||||
- Headers show the MXRoute → Mailcow forwarding path (two `Received:` hops)
|
||||
- No spam flagging
|
||||
|
||||
In Roundcube open the test message → **More → View Source** and check the `Received:` chain.
|
||||
|
||||
### Outbound Test
|
||||
|
||||
Send from `graymutt@nucking-futz.com` to an external Gmail address. Run through [https://mail-tester.com](https://mail-tester.com) for a full delivery score.
|
||||
|
||||
### DKIM/SPF/DMARC Test
|
||||
|
||||
Send a test to `check-auth@verifier.port25.com` — you will receive an automated reply confirming pass/fail for SPF, DKIM, and DMARC.
|
||||
|
||||
### Bank/Financial Test
|
||||
|
||||
Send from a bank address to `graymutt@nucking-futz.com` and confirm delivery. This is the primary goal — banks see MXRoute's commercial IPs in the MX record, not your residential AT&T IP.
|
||||
|
||||
---
|
||||
|
||||
## Email Client Settings
|
||||
|
||||
| Setting | Value |
|
||||
|---------|-------|
|
||||
| Email address | `graymutt@nucking-futz.com` |
|
||||
| IMAP server | `mail.nucking-futz.com` |
|
||||
| IMAP port | `993` (SSL/TLS) |
|
||||
| SMTP server | `mail.nucking-futz.com` |
|
||||
| SMTP port | `465` (SSL/TLS) |
|
||||
| Username | `graymutt@nucking-futz.com` |
|
||||
| Password | *(mailbox password set in Step 2.3)* |
|
||||
|
||||
> Users log in and send as `graymutt@nucking-futz.com`. Mailcow resolves this to the internal `mail.nucking-futz.com` mailbox transparently via the alias domain.
|
||||
|
||||
---
|
||||
|
||||
## Adding a New Mailbox
|
||||
|
||||
Every new address on `nucking-futz.com` requires entries in both Mailcow and MXRoute.
|
||||
|
||||
**In Mailcow:**
|
||||
1. Mail Setup → Mailboxes → Add mailbox
|
||||
2. Username: `newuser`, Domain: `mail.nucking-futz.com`
|
||||
|
||||
**In MXRoute control panel:**
|
||||
1. Forwarders → Create New Forwarder
|
||||
2. Forwarder Name: `newuser`, Destination Type: `Forward to Email(s)`, Recipients: `newuser@mail.nucking-futz.com`
|
||||
|
||||
---
|
||||
|
||||
## Credentials Reference
|
||||
|
||||
| Service | Account | Password |
|
||||
|---------|---------|----------|
|
||||
| Mailcow mailbox | `graymutt@mail.nucking-futz.com` | *(set during mailbox creation)* |
|
||||
| MXRoute relay | *(from MXRoute welcome email)* | *(from MXRoute welcome email)* |
|
||||
| MXRoute DirectAdmin | *(from MXRoute welcome email)* | *(from MXRoute welcome email)* |
|
||||
|
||||
---
|
||||
|
||||
## Known Gotchas
|
||||
|
||||
**Forwarder destination must not loop.** Never set the MXRoute forwarder destination to an address on the same domain that has MXRoute as its MX. `graymutt@nucking-futz.com` → `graymutt@nucking-futz.com` will loop. Always forward to `@mail.nucking-futz.com` which has its own MX resolving directly to Mailcow.
|
||||
|
||||
**Two DKIM selectors required.** `mailcow._domainkey.mail.nucking-futz.com` covers mail Mailcow sends directly from the subdomain. `x._domainkey.nucking-futz.com` (MXRoute selector) covers outbound mail relayed through MXRoute. Both must exist for DMARC to pass on all paths.
|
||||
|
||||
**New mailboxes need matching MXRoute forwarders.** MXRoute has no catch-all forwarding to remote servers. Every address that needs to receive mail must have an explicit forwarder in DirectAdmin. Add the MXRoute forwarder step to your mailbox creation checklist.
|
||||
|
||||
**Alias domain vs. alias mailbox.** The alias domain in Step 2.2 maps the entire `nucking-futz.com` domain to `mail.nucking-futz.com`. Do not also create individual alias mailboxes for the same addresses — this creates duplicate delivery and may cause unexpected behavior.
|
||||
|
||||
**SPF differs between the two domains.** The main domain SPF includes `include:mxroute.com` because MXRoute relay sends outbound from there. The subdomain SPF (`mail.nucking-futz.com`) only needs your ATT IP — Mailcow sends directly from that domain without going through MXRoute. Two different records for two different send paths.
|
||||
|
||||
---
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [MailCow Configuration](./mailcow)
|
||||
- [MXRoute Outbound Relay Setup](./mxroute-outbound-relay)
|
||||
- [OPNsense Firewall](./opnsense-firewall) — static IP allocation for ATT_Mail
|
||||
Loading…
Add table
Add a link
Reference in a new issue