Portward
Workflows

Email server setup, MX to DMARC, with a diff for every change

03
Domain mail

Mail DNS records for your own domain

An email server setup for your own domain starts with DNS, not with software. MX records say where mail for the domain is delivered, SPF lists the servers that may send for it, DKIM adds a signature that receivers can check, DMARC says what to do with mail that fails those checks, and the sending IP address should have a matching reverse DNS (PTR) name. Portward reads your records, lists what is missing and prepares each change as a diff for you to accept. Receivers judge IP reputation, so Portward cannot promise that mail reaches the inbox. Use this workflow for normal mail of your own domain on a server you own. Keep the work small: one record, one diff, one test.

01

Open the project folder

Create a folder for the domain, copy your zone file and any mail configuration into it, and open that folder as the working folder in Portward. File tools work inside that folder, so copy what you want the agent to read, and keep a copy of the zone file from before the first change in case you need to go back.

02

Ask for a record check

Choose Plan only or Ask first and describe the goal, for example: list the MX, SPF, DKIM and DMARC records in this zone file and tell me which are missing. The agent answers with a card for every tool call, and in Plan only mode it changes nothing while it lists what is missing.

03

Review each diff

Read the card for every change. The edit_file tool shows the new record next to the old one, and in Ask first mode nothing changes until you accept. Reject anything you do not understand and ask the agent to explain it before you try again.

04

Test from outside

Apply the records at your DNS provider, wait until they have spread, then run your own lookup command with Shell and compare the output with your zone file. Note every result in a log file in the working folder, with the date, the record you changed and what the lookup returned.

A set-up checklist for the server and its mail domain

vps-setup-checklist.txt
# checklist for my own VPS and its mail domain
step 1: update the system
step 2: create a normal user
step 3: log in with SSH keys
verify 1: key login works before password login is off
step 4: allow only the ports I need in the firewall
step 5: set the time zone and time sync
step 6: add MX, SPF, DKIM and DMARC records
verify 2: the sending IP has a matching PTR name
step 7: make a backup
verify 3: a test restore works

This plain checklist covers a VPS and the mail domain on it. Each verify row names a result you can check before you move on, such as key login, the firewall rules or a matching PTR name. Edit the rows for your own server, then ask the agent to work through them one at a time and report the real result of each. Add rows for your own services, and delete the rows that do not apply to your server.

Setting up email domain records with Portward

Read the records you have now

The agent opens the copy of your zone file with read_file and uses grep to list the MX, SPF, DKIM and DMARC lines, then reports in one card what is missing. In Plan only mode it writes this list as a plan and changes nothing, which is the safest way to begin on a domain that already receives mail. If you want to self host an email server at home, first find out whether you control a reverse DNS name for the sending IP address, because receivers judge IP reputation. You read the list and decide which record to add first. The agent works on a copy, so the original file stays untouched. Save the list of missing records in a notes file, so the next session starts from facts instead of memory.

Write the SPF and DKIM records

SPF lists the servers that may send for the domain, and DKIM adds a signature that receivers can check. The agent uses edit_file to add the SPF line to your zone file copy and shows it as a diff, and web_search finds the official documentation of your mail software when you need the exact syntax. The DKIM public key comes from your mail software, so paste it in yourself and let the agent place it. In Ask first mode the agent pauses before each change, and you compare the new line with the old one before you accept it. Add one record at a time and apply it at your DNS provider before the next one, so any mistake traces back to a single change.

Set the MX record and reverse DNS

The MX record names the host that receives mail for the domain, and the PTR name belongs to the IP address you send from. The agent adds the MX line with edit_file and keeps the priority you choose, then writes a short note with write_file that lists the host name you want as the reverse DNS name. Ask your provider to set it where the IP address is managed. How much hardening a new VPS needs depends on the services you run, and a mail service adds more ports to think about, so list them before you open any. Write the exact host name that your mail software uses, and let the agent compare it with the MX line and the PTR note so that the names agree.

Check the records and the mail flow

Run your own lookup command with Shell and let the agent compare the output with the zone file, one record at a time. Before mail goes live, review the base VPS security setup: key login, a firewall with only the ports you need and a tested backup. Then send a test message from your domain to an address you own and read the headers for SPF and DKIM results. The agent shows every result on a card, and you note the outcome in your log file. A passing test does not promise delivery to every inbox. If a check fails, paste the header lines into the chat, ask which record the receiver could not match and change one record at a time, then run the lookup command again.

Portward for Windows

Check your mail DNS records with reviewable steps

Download Portward ↗