Paper Lantern for cPanel accounts is being retired this year. Find out more »
cPanel & WHM Version 102 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Provide an API call to retrieve the current mail exchanger type (remote/local/auto)

swbrains shared this idea 58 days ago
Already Exists

I am looking for an API function to retrieve the current mail exchanger routing type (local/remote/auto) from within a hosted account (non-root). I can successfully set it using the set_always_accept API call, but I can't find a way to retrieve the current setting.

I found the function get_user_information , and while it's returned data description includes a hash called "mxcheck" which should contain the current mail routing type for each domain, "mxcheck" is not included anywhere in the main hash content that is returned. I dumped the main hash returned from the call using Perl's Data::Dumper, and could not locate any property called "mxcheck", or any property that seemed to contain the local/remote/auto setting that I'm looking for.

It would be acceptable to have get_user_information work as documented and return the current mail exchanger type or to have a new API function that provides that information.

Replies (1)

photo
1

Hey there! Would this API call work well for what you need?

https://api.docs.cpanel.net/openapi/cpanel/operation/list_mxs/

photo
1

Yes! That call returns the necessary settings, both the explicitly set method (including "auto") and the detected method. It works in my tests here. Thanks!

photo
1

You're welcome! I'll mark this as "already exists" then since that works well for your situation.

photo
1

Sounds good and thanks again!

photo
Leave a Comment
 
Attach a file