Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aldanor/71ed6802e3c14d3b15fb3f727a72c859 to your computer and use it in GitHub Desktop.
Save aldanor/71ed6802e3c14d3b15fb3f727a72c859 to your computer and use it in GitHub Desktop.
Add email subdomains - MXROUTE email service provider and DirectAdmin control panel

The Setting up SPF and DKIM records of a subdomain thread on StackExchange goes more into the details.

1. Log in to DirectAdmin

In the [MXroute] Important Account Information email there is a section titled "Login Info:", similar to

=====
===== Login Info:
=====

Control Panel Login URL: https://blizzard.mxrouting.net:2222
Control Panel Username: gibberish
Control Panel Password: gobbledygook
  1. Go to Account Manager > Domain Setup

    Ignore Subdomain Management - doing anything there will have no effect!

  2. Click on ADD NEW

  3. On the first line (Domain:) enter your desired subdomain in the format sub.domain.TLD (e.g., forum.my-project.com)

  4. Click on CREATE

  5. Go to E-mail Manager > E-mail Accounts

  6. At the very top of the page click on the drop-down menu after Domain, and choose your newly created subdomain

  7. Click on CREATE ACCOUNT

  8. Fill out, and click on CREATE ACCOUNT button

2. Add domain DNS entries

In the [MXroute] Important Account Information email there is a section titled "DNS Records", with details on MX records, SPF, and DKIM. All these will need to be applied to your subdomain as well.

MX records

Taking forum.my-project.com subdomain as an example, these are the entries, where @ and forum would go to an input field titles "host" or "name" (or similar), and the MXROUTE mail servers under "target".

NOTE: The first 2 is for your main domain (i.e., my-project.com), and the last 2 are for your subdomain (i.e., forum.my-project.com).

MX      @       blizzard.mxrouting.net (Priority: 10)       1 Hour
MX      @       blizzard-relay.mxrouting.net (Priority: 20) 1 Hour
MX      forum   blizzard.mxrouting.net (Priority: 10)       1 Hour
MX      forum   blizzard-relay.mxrouting.net (Priority: 20) 1 Hour

SPF

Following the same pattern, add the SPF entry for your subdomain:

NOTE: The first one is for your main domain (i.e., my-project.com), and the last one are for your subdomain (i.e., forum.my-project.com).

TXT     @       v=spf1 include:mxlogin.com -all 1 Hour
TXT     forum   v=spf1 include:mxlogin.com -all 1 Hour

DKIM

The subdomain will need to be appended after x._domainkey so it becomes x._domainkey.forum, and to get the actual value to insert into the TXT record (i.e., the DKIM public key), follow the recommended MXROUTE docs to set up DKIM but make sure to use the modified name (in this case, x._domainkey.forum).

NOTE: The first one is for your main domain (i.e., my-project.com), and the last one are for your subdomain (i.e., forum.my-project.com) where the two public keys (the part starting with v=DKIM1; k=rsa; ...) are not the same.

TXT     x._domainkey         v=DKIM1; k=rsa; p=MI... 1 Hour
TXT     x._domainkey.forum   v=DKIM1; k=rsa; p=MI... 1 Hour

If this doesn't work with your provider/registrar/etc. then you may have to add the full domain name:

TXT     x._domainkey                        v=DKIM1; k=rsa; p=MI... 1 Hour
TXT     x._domainkey.forum.my-project.com   v=DKIM1; k=rsa; p=MI... 1 Hour

INFO: See this answer for further reading and links to the corresponding RFCs.

3. Test it

With mail-tester, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment