Question
How do you change the email routing of a domain with the API?
Answer
If you change the mail host of a domain already configured on your cPanel server, you must change the email routing so that mail is sent to the correct server.
- Access the server's command line as the 'root' user via SSH or Terminal in WHM.
-
Run the following command:
# uapi --user=$username Email set_always_accept domain='$domain.tld' alwaysaccept=$location
Note: "$username" must be replaced with the cPanel account's username. While "$domain.tld" must be replaced with the domain that needs the email routing changed. Finally, "$location" must be replaced with "local" if the local mail server will receive mail for the domain or "remote" if it will not.
Comments
0 comments
Article is closed for comments.