Hi Joshua,
Firstly, thank you so much for creating such an amazing piece of open source software.
Coming to the point in case, I have been trying to setup the ‘Mail-in-a-box’ email server on Digital Ocean from the past few days. But I haven’t been able to successfully set it up. Kindly read below the steps I have taken so far.
I have kept it detailed so that you can help spot the problem easily.
Use Case
Setting up: 'Mail-in-a-box' email server
Hosting: Digital Ocean
Domain Registrar: BigRock
Problems: Nameserver glue records, TLSA and DNSSEC
Reference: Screenshot at end of this message
List of steps I took:
-
Created a DO droplet of
1GB 1vCPU 25GB SSD
, took hostname asbox.example.com
-
Then I modified our host files in ‘/etc/hosts/’ to associate the hostname with the server’s IP address by this
127.0.0.1 localhost.localdomain localhost
our_server_ip box.example.com box
- Then I installed ‘Mail-in-a-box’ to get our mail server up and running with all things including security, SSL certificate, UFW firewall, anti-spam, graylisting, SPF, DKIM, DMARC, opportunistic TLS, strong ciphers, HSTS, and DNSSEC (this is the only thing I haven’t implemented yet).
I used this command:
curl -s https://mailinabox.email/bootstrap.sh | sudo bash
- Then it asked for an email address, I set it up as
support@example.com
Then it asked for hostname, I set it up as box.example.com
And the country as India.
- Then I added the following name servers to both, the child nameservers section and to the NS records for
example.com
at our domain registrar BigRock. I waited for some time after that, but no propagation happened.
Hostname: ns1.box.example.com
IP Address: our_ip_address
Hostname: ns2.box.example.com
IP Address: our_ip_address
- Then a Digital Ocean support specialist pointed out that adding the above to the NS records for
example.com
is not a good practice. So I removed it from there. But I let the child records be there. After which I discovered the external DNS section which exists in Mail-in-a-box > System > External DNS.
Also, adding ns1.box.example.com
and ns2.box.example.com
to the name servers causes an overlap and loads the box.example.com
when example.com
is visited.
- I entered all the feilds in TXT, MX, A, AAAA, SRV, and (TLSA not available at DO) with the values provided in the external DNS with nameservers as
ns1.box.example.com
andns2.box.example.com
in Digital Ocean DNS.
Under Mail-in-a-box > System > External DNS, I had to add a lot of records, but I couldn’t understand the following:
7.1 CALDAVS
_caldavs._tcp.example.com SRV 0 0 443 box.example.com.
Recommended. Specifies the hostname of the server that handles CardDAV/CalDAV services for email addresses on this domain.
The SRV values I added:
HOSTNAME: _caldavs._tcp.example.com
WILL DIRECT TO: box.example.com
PORT: 443
PRIORITY: 0
WEIGHT: 0
TTL (SECONDS): 1800
Are they correct?
7.2 CARDDAVS
_carddavs._tcp.example.com SRV 0 0 443 box.example.com.
‘Recommended. Specifies the hostname of the server that handles CardDAV/CalDAV services for email addresses on this domain.’
The SRV values I added:
HOSTNAME: _carddavs._tcp.example.com
WILL DIRECT TO: box.example.com
PORT: 443
PRIORITY: 0
WEIGHT: 0
TTL (SECONDS): 1800
Are they correct?
7.3 DNSSEC
Both DO and BigRock don’t have DNSSEC. Any workarounds?
7.4.a TLSA
_25._tcp.box.example.com TLSA 3 1 1 <random string>
Recommended when DNSSEC is enabled. Advertises to mail servers connecting to the box that mandatory encryption should be used.
Since I couldn’t find TLSA records in the DNS settings of example.com
. I added the above as a CAA record. Is that right? Also, where does the random string go?
HOSTNAME: _25._tcp.box.example.com
AUTHORITY GRANTED FOR: box.example.com
TAG: issue
FLAGS: 0
TTL (SECONDS): 1800
7.4.b TLSA
_443._tcp.box.example.com TLSA 3 1 1 <random string>
Optional. When DNSSEC is enabled, provides out-of-band HTTPS certificate validation for a few web clients that support it.
Since I couldn’t find TLSA records in the DNS settings of example.com
. I added the above as a CAA record. Is that right? Also, where does the random string go?
HOSTNAME: _443._tcp.box.example.com
AUTHORITY GRANTED FOR: box.example.com
TAG: issue
FLAGS: 0
TTL (SECONDS): 1800
- We still can’t send mails and we see this error in our Mail-in-a-box > System > External DNS:
’Nameserver glue records (ns1.box.example.com
and ns2.box.example.com
) should be configured at your domain name registrar as having the IP address of this box (our_ip_address). They currently report addresses of [Not Set]/[Not Set]. If you have set up External DNS, this may be OK.'
- The below records exist as ‘child name servers’ at BigRock. And the rest of records reside inside the Digital Ocean DNS management system.
Hostname: ns1.box.example.com
IP Address: our_ip_address
Hostname: ns2.box.example.com
IP Address: our_ip_address
Hmm, now? Hoping that you were able to spot the problem here and will be able to help out.
Many thanks,
Brijesh