Account creation via API defaults to local mail exchanger

bmett

Well-Known Member
Aug 5, 2010
71
1
56
Brisbane, AU
Hi there,

For some reason, all accounts we create via the WHM API end up will the mail exchanger set to "local", despise the fact the mx records are pointing to an external mail server by default.

How can I fix this? New accounts need to have the mail exchanger set to "external"/

Cheers
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
Hi @bmett

It doesn't actually matter "where" the MX records are pointed to for this purpose the MX defaults to local if you're not putting it in. You should be setting the mxcheck parameter to auto if you have some domains that are remote and some that are local.

This is explained in the documentation @JayFromEpic linked:

mxcheck string
The account's main mail exchanger's type.

Note:

The function does not configure the primary MX entry to point to the appropriate exchanger. You must perform this function separately.

This parameter defaults to local.

  • local
  • secondary
  • remote
  • auto
 

bmett

Well-Known Member
Aug 5, 2010
71
1
56
Brisbane, AU
Actually, one more question:

How would I go about changing a lot of accounts on one server to "remote mail exchanger"? Is there a script I can run? After a mass account restore, all accounts (several hundred) on the server are set to "local mail exchanger" although all of them have external MX records.

I was under the impression that removing all domains from /etc/localdomains and adding them to /etc/remotedomains would fix this, but it doesn't. Do I need to restart or rebuild anything after editing above to lists?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston