Configure Website and Email on different servers and dkim records

nunoleite

Well-Known Member
Jun 4, 2007
68
4
158
Hi!

I have 2 cPanel servers and i have a website on server1 and have configured emails on server2.

Let's call it domain.com

Now i will explain what i have done to achieve this.

I have configured the domain.com on server1 as normal.

The nameservers of the domain.com are pointing to server1.

Then i have configured the same domain.com on server2 as normal.

On server1 where is the website, i made the next changes:
  1. on Zone Editor i added the ip of server2 in the spf record:
    domain.com. TXT v=spf1 +a +mx +ip4:xxx.xxx.xxx.xxx +include:spf.server2.com ~all
  2. removed the record:
    domain.com. 14400 MX Priority: 0 Destination: domain.com
  3. added these 2 records to point mx to the server2:
    domain.com. MX 10 mx1.server2.com
    domain.com. MX 20 mx2.server2.com
  4. removed the CNAME of mail.domain.com:
    mail.domain.com. 14400 CNAME domain.com
  5. added a record A pointing to the server2, so that i can use the mail.domain.com has my address server for emails:
    mail.domain.com. 14400 A xx.xx.xx.xx
  6. changed these 3 record to point to server2
    autoconfig.domain.com. 14400 A xx.xx.xx.xx
    autodiscover.domain.com. 14400 A xx.xx.xx.xx
    webmail.domain.com. 14400 A xx.xx.xx.xx
    (so i can use this address to access webmail on server2)
  7. on Email Routing changed to Remote Mail Exchanger
  8. On the DKIM record (default._domainkey.domain.com.) i have copied the same DKIM record from server2
On server2 where it will have only the emails:
  1. I have made a redirect:
    All Public Domains pointing to https://mail.domain.com/webmail so that i can use mail.domain.com and mail.domain.com/webmail to access the webmail page of the server2
  2. just configured all the necessary emails

So, my question is.... it this correct? Do i need to do more? Or, do i have to change/correct something?

It seems to be working but I'm not sure about the DKIM record. The emails need to have all the measures anti-spam applied.

I know that this can be done with Office365 just changing some records from cPanel (MX, SPF and autodiscover) and not messing with DKIM and anything else. So, how they make this work? The DKIM should be invalid, but it's not.

Any ideas?

Thanks
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,285
2,434
363
cPanel Access Level
Root Administrator
Hey there! That all sounds good to me - you just point the MX and A records like you did, and then mail will get sent to the other machine. You will also want to update the setting inside cPanel >> Email Routing to the "Remote" option - that way, any local messages will look to the DNS records instead of getting delivered locally.
 

nunoleite

Well-Known Member
Jun 4, 2007
68
4
158
Hi!

Good.

Now... about spam... to make all the sending correct and email to not falling in the Spam folders, is this enough? Outlook395 doesn't need to have de dkim record configured, why?

Thanks
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,285
2,434
363
cPanel Access Level
Root Administrator
There is never a guarantee that your messages won't get sent to spam at certain providers. The only real answer is to deal with it as it comes up. Having SPF/DKIM/DMARC will certainly help that situation.

I can't comment on why Outlook365 configuration settings since that isn't something we have any control of, so it might be best to reach out to them.
 

nunoleite

Well-Known Member
Jun 4, 2007
68
4
158
Hi,

I just wanted to have a similar configuration that can be Spam proof. ;)

If this is the path to go, then that's how I'll have to do it.

Thanks
 
  • Like
Reactions: cPRex