MX record templates (SKINS)(TEMPLATES)

Version 1.56

Feature
Finished

Users can pick google/zoho from a list, to remove their MX records and replace them with the values in the template. New item at the bottom of the page: CMD_DNS_MX?domain=domain.com "Set remote MX records" Enabled by default in the directadmin.conf: mx_templates=1 to disable it, set: mx_templates=0 and restart directadmin. Note: It does not change the "Local Mailserver" checkbox, this is still manually controlled. ==================== TEMPLATES new directory: /usr/local/directadmin/data/templates/mx with 2 default templates: google.com.txt zoho.eu.txt Containing their default MX record settings for those services. The top will also set: |?NAME=Google Suite MX| To give the select box a human readable name, but the selected value in the form is still google.com.txt. ==================== CUSTOM TEMPLATES You can add more .txt files into the templates/mx directory (in theory they could be overwritten if we ever "happen" to include files with those names), but if you want to override the 2 .txt files.. or just add more in a more clear way, this is the custom mx templates path: /usr/local/directadmin/data/templates/mx/custom/ ==================== SKIN user/dns_mx_control.html uses the token check, representing the mx_tokens=1 directadmin.conf value: |*if MX_TEMPLATES="1"| The |MX_TEMPLATES_SELECT| token contains the selectbox for the available templates, plus "default" to revert the User back. =================== POSTING CHANGES CMD_DNS_MX | CMD_API_DNS_MX method: POST action=mx_template domain=domain.com mx_template=google.com.txt|zoho.eu.txt|default =================== JSON CMD_DNS_MX?domain=domain.com&json=yes will return one new entry if mx_templates=1 is enabled in the directadmin.conf. If it's not present, then it's either shut off, or an older directadmin version. "mx_templates": { "mx_templates_select": { "0": { "selected": "yes", "text": "-- Select MX Template --", "value": "..." }, "1": { "text": "Revert to Local Default", "value": "default" }, "2": { "text": "Google Suite MX", "value": "google.com.txt" }, "3": { "text": "Zoho Mail", "value": "zoho.eu.txt" } } }

Interested to try DirectAdmin? Get a 30-day Free Trial!