<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Your first domain and mailbox, and the DNS records your domain needs]]></title><description><![CDATA[<p dir="auto">This topic takes a freshly installed hMailServer 6.3.4 to its first working mailbox, proves it locally, and then lists the DNS records without which its mail either does not arrive or is filed as spam. The one thing to know first: the domain's <strong>Postmaster address</strong> box is the catch-all, not the <code>postmaster@</code> mailbox the email standards ask for. Create <code>postmaster@</code> as an account, and leave that box empty unless you want every misaddressed message accepted and stored. The paths below are the Windows Control Panel's; on Linux, which has no Control Panel, the same is done in the Control Deck or over the REST API.</p>
<h3><a class="anchor-offset" name="if-you-are-learning-make-the-sample-domain-first-since-6.3.4"></a>If you are learning, make the sample domain first (since 6.3.4)</h3>
<p dir="auto">One button, on the Control Panel's Welcome page and on the Control Deck's Checklist view, or one command (<code>hmctl sample-domain create</code>, <code>hmailserver --sample-domain create</code> on Linux, <code>POST /api/v1/setup/sample-domain</code>) makes a throwaway <code>example.test</code>: three mailboxes, a distribution list of the three, one rule and eight delivered messages. The same button, or <code>... remove</code>, takes it away and says what it removed; a domain called <code>example.test</code> that it did not make is never touched.</p>
<p dir="auto">All three mailboxes sign in with one password, which the server mints when it makes the sample: twenty characters of Crockford base32, grouped in fives. It is shown once, in the answer to the call that made the sample, and is stored nowhere, so write it down; if you lose it, remove the sample and make it again. Older wiki text that speaks of "one documented password" describes an earlier version of the feature and is out of date. <strong>Remove the sample before the server takes real mail.</strong> Its mailboxes are ordinary accounts that can sign in and relay.</p>
<h3><a class="anchor-offset" name="add-your-domain"></a>Add your domain</h3>
<p dir="auto">Go to <strong>Accounts &amp; domains → Domains</strong>, type the name and press <strong>Add domain</strong>, then select it and press <strong>Properties</strong>. On Linux, use the Deck's <em>Domains</em> view, or:</p>
<pre><code class="language-sh">curl -u Administrator -H "Content-Type: application/json" \
     -d '{"name":"example.com","active":true}' \
     http://127.0.0.1:8045/api/v1/domains
</code></pre>
<p dir="auto"><code>postmaster</code> is optional in that body and is left out here, because it is the same catch-all field. The call answers <code>400</code> if the name is not a valid domain name and <code>409</code> if it already exists. Since 6.3.4 the Control Panel's domain editor has fourteen tabs; the seven that 6.3.4 added are each off, or empty, until set. The fields that matter on the first day:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Tab</th>
<th>Field</th>
<th>Default</th>
<th>What happens when it is wrong</th>
</tr>
</thead>
<tbody>
<tr>
<td>General</td>
<td>Domain enabled</td>
<td>ticked</td>
<td>Unticked: every <code>RCPT TO</code> is answered <code>550 Domain has been disabled.</code></td>
</tr>
<tr>
<td>General</td>
<td>Domain name</td>
<td></td>
<td>The part after the <code>@</code>. Setting it to the host name (<code>mail.example.com</code>) is the classic first-day mistake</td>
</tr>
<tr>
<td>General</td>
<td>Postmaster address</td>
<td>empty</td>
<td><strong>The catch-all.</strong> Set: no address in the domain can be refused. Empty: unknown recipients get <code>550 Unknown user</code></td>
</tr>
<tr>
<td>Limits</td>
<td>Maximum message size (KB)</td>
<td><code>0</code></td>
<td><code>0</code> falls back to the server-wide <code>maxmessagesize</code>, seeded at 20480 KB</td>
</tr>
<tr>
<td>Limits</td>
<td>Enable plus addressing</td>
<td>off, <code>+</code></td>
<td>Off: <code>alice+invoices@</code> is an unknown recipient</td>
</tr>
<tr>
<td>Relay</td>
<td>Relay host</td>
<td>empty</td>
<td>Where mail <strong>from</strong> this domain leaves through. This is not a route</td>
</tr>
<tr>
<td>DKIM</td>
<td>Enable signing</td>
<td>off</td>
<td>Enabling before the DNS record is live makes every message fail DKIM at the receiver</td>
</tr>
</tbody>
</table>
<p dir="auto">In <code>RecipientParser::CheckDeliveryPossibility</code>, an address that matches no account, alias, distribution list or route falls through to the postmaster address and the resolution restarts with it. That is why the box is a catch-all.</p>
<h3><a class="anchor-offset" name="add-a-mailbox"></a>Add a mailbox</h3>
<p dir="auto">Select the domain, type the address and a password under the account list, and press <strong>Create account</strong>; then <strong>Edit</strong> for the full editor.</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Field</th>
<th>Value to use</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>Password</td>
<td>Press <strong>Generate strong password</strong></td>
<td>16 characters from a cryptographic RNG, shown once and copied to the clipboard</td>
</tr>
<tr>
<td>Administration level</td>
<td><strong>Normal user</strong></td>
<td><strong>Server administrator</strong> can manage everything. Give it only to yourself</td>
</tr>
<tr>
<td>Quota (MB)</td>
<td><code>0</code> for unlimited</td>
<td></td>
</tr>
<tr>
<td>Account enabled</td>
<td>ticked</td>
<td>Unticked: <code>550 Account is not active.</code> at <code>RCPT TO</code></td>
</tr>
</tbody>
</table>
<p dir="auto">On Linux, make the account on the Control Deck or with <code>POST /api/v1/domains/{domain}/accounts</code>. Create at least <code>postmaster@yourcompany.com</code> and your own mailbox. A full mailbox is refused during the SMTP conversation, not bounced: with <code>RejectFullMailboxAtRcpt</code> on, as it is by default, <code>RCPT TO</code> is answered <code>452 4.2.2 Mailbox is full.</code>, a temporary refusal, so the sending server holds the message and no backscatter is sent.</p>
<p dir="auto">Since 6.3.4, accounts can be imported from a CSV file over REST, with <code>hmctl</code> and with the PowerShell module, with a dry run that changes nothing; and an identity provider can make and remove them over SCIM. Three things about an account are set only on the Control Deck and over REST, not in the Control Panel: its kind (a person, a room or equipment), encryption at rest, and a webhook route.</p>
<h3><a class="anchor-offset" name="how-an-address-is-resolved"></a>How an address is resolved</h3>
<p dir="auto">Every <code>RCPT TO</code> is answered by one function, in a fixed order that ends at the domain's postmaster address; the full order, with domain aliases, plus addressing and the webhook route, is in <a href="/topic/28270">Aliases, distribution lists and public folders</a>. What it means on the first day:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Question</th>
<th>Answer</th>
</tr>
</thead>
<tbody>
<tr>
<td>Why did mail to a mistyped address get delivered?</td>
<td>The domain has a postmaster address, so it fell through to the catch-all</td>
</tr>
<tr>
<td>Why does <code>alice+anything@</code> not work?</td>
<td>Plus addressing is off by default and is per domain</td>
</tr>
<tr>
<td>Why does an alias to an external address still count as local?</td>
<td>Only at the first hop, so that it is treated as inbound mail and not as relaying</td>
</tr>
</tbody>
</table>
<h3><a class="anchor-offset" name="test-it-locally-before-touching-dns"></a>Test it locally, before touching DNS</h3>
<p dir="auto">The test below works because a fresh database's <em>My computer</em> IP range lets the server itself, on <code>127.0.0.1</code>, send as one of its own domains without a password, while anyone may send you mail and nobody may relay through you without logging in. A refused direction is <code>550 Delivery is not allowed to this address.</code>; one that needs authentication is <code>530 SMTP authentication is required.</code> The two seeded ranges and what each allows are in <a href="/topic/28239">IP ranges, auto-ban, lockout and sending limits</a>.</p>
<pre><code class="language-powershell">Send-MailMessage -SmtpServer localhost -Port 25 `
   -From "you@yourcompany.com" -To "you@yourcompany.com" `
   -Subject "First test" -Body "If you can read this, hMailServer is working."
</code></pre>
<p dir="auto">Or by hand with <code>telnet localhost 25</code>. The replies worth recognising:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Line</th>
<th>What it tells you</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>250-SIZE 20971520</code></td>
<td>The server-wide <code>maxmessagesize</code>, 20480 KB, in bytes</td>
</tr>
<tr>
<td><code>250-STARTTLS</code></td>
<td>Present only when the port's connection security is STARTTLS optional or required</td>
</tr>
<tr>
<td><code>250 AUTH …</code></td>
<td>Absent when the port requires TLS, or the connecting range requires TLS when authenticating</td>
</tr>
<tr>
<td><code>250 2.0.0 Queued (0.016 seconds)</code></td>
<td>The message is on disk and in the database</td>
</tr>
<tr>
<td><code>250 2.0.0 Queued for delivery</code></td>
<td><strong>Not</strong> the same reply: the message was quarantined</td>
</tr>
</tbody>
</table>
<p dir="auto">Then check <strong>Monitoring &amp; troubleshooting → Delivery queue</strong>, which should be empty, and look on disk: a delivered message is one file, <code>C:\Program Files\hMailServer\Data\yourcompany.com\you\a3\{a3f01e6c-....eml}</code>. Its first <code>Received</code> header reads <code>with ESMTP</code>, and <code>with ESMTPSA</code> for an authenticated submission over TLS.</p>
<h3><a class="anchor-offset" name="the-dns-records-your-domain-needs"></a>The DNS records your domain needs</h3>
<p dir="auto">Do them in this order. Replace <code>yourcompany.com</code> and <code>203.0.113.10</code> with your own.</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Record</th>
<th>Example</th>
<th>Without it</th>
</tr>
</thead>
<tbody>
<tr>
<td>A / AAAA</td>
<td><code>mail.yourcompany.com. IN A 203.0.113.10</code></td>
<td>Nothing resolves; the MX points at nothing</td>
</tr>
<tr>
<td>MX</td>
<td><code>yourcompany.com. IN MX 10 mail.yourcompany.com.</code></td>
<td>Inbound mail bounces as "no mail server for this domain"</td>
</tr>
<tr>
<td>PTR</td>
<td><code>10.113.0.203.in-addr.arpa. IN PTR mail.yourcompany.com.</code></td>
<td>Google and Microsoft refuse or spam-folder outbound mail</td>
</tr>
<tr>
<td>SPF</td>
<td><code>yourcompany.com. IN TXT "v=spf1 mx a:mail.yourcompany.com ~all"</code></td>
<td>Anybody can forge your domain; DMARC cannot pass on the SPF side</td>
</tr>
<tr>
<td>DKIM</td>
<td><code>dkim._domainkey.yourcompany.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq..."</code></td>
<td>Forwarded mail fails everything, because forwarding breaks SPF</td>
</tr>
<tr>
<td>DMARC</td>
<td><code>_dmarc.yourcompany.com. IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@yourcompany.com"</code></td>
<td>No policy and no reports</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>A / AAAA and MX.</strong> Add an <code>AAAA</code> only if the machine has a public IPv6 address that answers. An MX must point at a host name, never an IP address, and that name must not be a CNAME. The MX name is what MTA-STS matches, what TLSA records hang off, and what the certificate on port 25 should be issued for.</p>
<p dir="auto"><strong>PTR.</strong> Only your ISP or hosting provider can set it. It should name the same host as your <code>HELO</code>/<code>EHLO</code>, which hMailServer takes from <strong>Connections &amp; protocols → Protocols → SMTP</strong>, <em>Host name (HELO/EHLO greeting)</em>, falling back to the Windows computer name when blank. The Control Panel's DNS records page does not check it, and says so.</p>
<p dir="auto"><strong>SPF.</strong> Start with <code>~all</code>; move to <code>-all</code> once the DMARC reports have shown you every system that sends as you. Publish exactly one SPF record per name: two beginning <code>v=spf1</code> is a permanent error at every receiver. RFC 7208 caps the DNS-querying mechanisms at ten. In the other direction, checking SPF on incoming mail as a scored test is off by default (<code>usespf</code> is seeded 0), but DMARC checking is on by default and evaluates SPF and DKIM itself.</p>
<p dir="auto"><strong>DKIM.</strong> On the domain's <strong>DKIM</strong> tab click <strong>Generate key pair…</strong>: it creates an RSA-2048 key, saves the private key and shows the exact record, with a <strong>Copy DNS value</strong> button. <code>dkim</code> is the default selector. Switching signing on is gated on the published record matching. Ed25519 is supported too, with a key you supply. Since 6.3.4 a rotation policy per domain generates the new key under a dated selector (<code>s20260915</code>), checks the record every fifteen minutes and switches signing only once it has carried that key for a propagation period. It never edits DNS, and it is off until switched on.</p>
<p dir="auto"><strong>DMARC.</strong> Start with <code>p=none</code>, read the reports for a few weeks, then tighten to <code>p=quarantine</code> and <code>p=reject</code>. Do not start at <code>p=reject</code>. The DNS records page pre-fills <code>rua=</code> with the domain's postmaster address and omits the tag when there is none. Since 6.3.4, name that mailbox as the domain's <strong>report mailbox</strong> and the server parses the DMARC and TLS-RPT reports that arrive there and charts them on the Control Deck's DMARC page. Nothing read there acts on any mail.</p>
<p dir="auto"><strong>Optional hardening</strong>, at any point afterwards:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Record</th>
<th>Name</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>MTA-STS</td>
<td><code>_mta-sts.yourcompany.com. IN TXT "v=STSv1; id=20260908120000"</code></td>
<td>hMailServer serves the policy itself once <code>WebServicesHttpsPort</code> is set and the listener has a certificate for <code>mta-sts.yourcompany.com</code>; <code>MtaStsPolicyMode</code> defaults to <code>enforce</code>, so set it to <code>testing</code> to start</td>
</tr>
<tr>
<td>TLS-RPT</td>
<td><code>_smtp._tls.yourcompany.com. IN TXT "v=TLSRPTv1; rua=mailto:tlsrpt@yourcompany.com"</code></td>
<td>Asks other servers to tell you when TLS to you failed</td>
</tr>
<tr>
<td>TLSA</td>
<td><code>_25._tcp.mail.yourcompany.com. IN TLSA 3 1 1 &lt;sha256 of the certificate public key&gt;</code></td>
<td>Only meaningful if your zone is DNSSEC-signed. Re-publish before you rotate a certificate, never after</td>
</tr>
<tr>
<td>CNAME</td>
<td><code>autoconfig</code>, <code>autodiscover</code>, <code>mta-sts</code> → <code>mail.yourcompany.com.</code></td>
<td>For client autoconfiguration and the policy host</td>
</tr>
<tr>
<td>A / AAAA / CNAME</td>
<td><code>openpgpkey.yourcompany.com</code></td>
<td>Since 6.3.4, only if you publish OpenPGP keys</td>
</tr>
</tbody>
</table>
<p dir="auto">BIMI is read, not published: since 6.3.4 the webmail shows a sender's logo, but this server publishes no BIMI record for your domains.</p>
<h3><a class="anchor-offset" name="checking-your-work"></a>Checking your work</h3>
<p dir="auto">Give DNS an hour to propagate. <strong>Monitoring &amp; troubleshooting → DNS records</strong> lists, per domain, the exact SPF, DKIM, DMARC, MTA-STS and TLS-RPT records to publish, with a <strong>Check</strong> button per record:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Verdict</th>
<th>What to do</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Not published</strong></td>
<td>Publish it</td>
</tr>
<tr>
<td><strong>Published but different</strong></td>
<td>Compare the two; the page shows what is there</td>
</tr>
<tr>
<td><strong>Published and correct</strong></td>
<td>Nothing</td>
</tr>
<tr>
<td><strong>Lookup failed</strong></td>
<td>A resolver or network problem, not a DNS-content one. Retry</td>
</tr>
</tbody>
</table>
<p dir="auto">On Linux the Control Deck has a DNS records view. On either platform the first-hour checklist (since 6.3.4) judges the <code>spf</code>, <code>dkim</code> and <code>dmarc</code> items itself, for the first twenty active domains. From a command line:</p>
<pre><code class="language-powershell">Resolve-DnsName yourcompany.com -Type MX
Resolve-DnsName yourcompany.com -Type TXT
Resolve-DnsName dkim._domainkey.yourcompany.com -Type TXT
Resolve-DnsName _dmarc.yourcompany.com -Type TXT
Resolve-DnsName 10.113.0.203.in-addr.arpa -Type PTR
</code></pre>
<p dir="auto"><a href="/topic/28188">Being trusted by the servers you send to</a> takes deliverability further.</p>
<h3><a class="anchor-offset" name="the-ports-your-users-will-need"></a>The ports your users will need</h3>
<p dir="auto">The create scripts seed four listeners, SMTP 25 and 587, POP3 110 and IMAP 143, with no encryption. Since 6.3.4 a new installation sets all four to STARTTLS optional with the self-signed certificate and requires TLS for authentication from the <em>Internet</em> IP range; an upgraded server is left as it was (<a href="/topic/28241">Hardening a public mail server</a>). Ports 465, 993 and 995 are not created for you: add them on <strong>Connections &amp; protocols → TCP/IP ports</strong> once you have a certificate.</p>
<p dir="auto">A TLS port with no certificate selected does not start (HM5113, <code>Error initializing SSL. Certificate not set.</code>); a port already in use is HM4316. Which connection security each port should have, and why STARTTLS optional belongs on port 25 alone, is in <a href="/topic/28255">Connecting a mail client</a>; which ports to open in the firewall is in <a href="/topic/28226">Every port hMailServer listens on</a>.</p>
<h3><a class="anchor-offset" name="before-you-tell-anyone-the-address"></a>Before you tell anyone the address</h3>
<ul>
<li><code>postmaster@</code> exists as a real account.</li>
<li>MX, SPF, DKIM and DMARC are published and verified.</li>
<li>A certificate is installed and the client ports created: <a href="/topic/28187">Let's Encrypt certificates are automatic</a>.</li>
<li>The administrator password is a PBKDF2 one. 6.3.4's installer writes it so; the wiki's checklist item about changing it from "the installer's MD5" describes 6.3.3 and earlier.</li>
<li>A backup that you have restored once.</li>
</ul>
<h3><a class="anchor-offset" name="what-it-does-not-do-and-where-to-read-more"></a>What it does not do, and where to read more</h3>
<p dir="auto">Nothing here publishes a DNS record for you: the Control Panel builds the text and checks it, and the DKIM rotation never edits DNS. The PTR record is your provider's to set. More on the records above: <a href="/topic/28258">DKIM rotation, DMARC and TLS reports</a>, and <a href="/topic/28257">Requiring TLS</a> for MTA-STS, TLS-RPT and DANE. The webmail and browser administration are separate topics: <a href="/topic/28191">The webmail portal at /portal</a> and <a href="/topic/28192">The Control Deck</a>.</p>
<p dir="auto">Sources: the wiki's <a href="https://gitlab.com/hmailserver/hmailserver/-/wikis/Your-First-Domain-and-Mailbox" rel="nofollow ugc">Your First Domain and Mailbox</a>, <a href="https://gitlab.com/hmailserver/hmailserver/-/wikis/DNS-for-Your-Domain" rel="nofollow ugc">DNS for Your Domain</a> and <a href="https://gitlab.com/hmailserver/hmailserver/-/wikis/Ports-Reference" rel="nofollow ugc">Ports Reference</a>; <a href="https://gitlab.com/hmailserver/hmailserver/-/blob/v6.3.4/hmailserver/docs/SampleDomain.md" rel="nofollow ugc">SampleDomain.md</a> and <a href="https://gitlab.com/hmailserver/hmailserver/-/blob/v6.3.4/hmailserver/docs/SetupChecklist.md" rel="nofollow ugc">SetupChecklist.md</a>; and chapters <a href="https://www.progressiverobot.com/hmailserver-documentation/#6-your-first-domain-and-mailbox" rel="nofollow ugc">6</a>, <a href="https://www.progressiverobot.com/hmailserver-documentation/#8-making-the-internet-trust-you-dns" rel="nofollow ugc">8</a> and <a href="https://www.progressiverobot.com/hmailserver-documentation/#22-ports-reference" rel="nofollow ugc">22</a> of the public documentation.</p>
]]></description><link>https://www.hmailserver.co.uk/topic/28229/your-first-domain-and-mailbox-and-the-dns-records-your-domain-needs</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Nov 2026 09:05:50 GMT</lastBuildDate><atom:link href="https://www.hmailserver.co.uk/topic/28229.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 27 Sep 2026 19:11:13 GMT</pubDate><ttl>60</ttl></channel></rss>