mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
13.98k stars 1.44k forks source link

When adding MX record in Custom DNS the format is incorrect in the signed zone file #1513

Open alento-group opened 5 years ago

alento-group commented 5 years ago

https://discourse.mailinabox.email/t/domain-appears-with-double-ending-when-using-custom-mx-record/4405

When adding a custom MX record for a domain in which the mail is not served by the local MiaB install the signed MX record is incorrect. It appears correct everywhere else.

Ex: adding a MX record for mx.tempdns2.tk on the custom DNS page at https://box.tempdns.tk/admin

10 mx.tempdns2.tk

when you dig that record it will return:

;; QUESTION SECTION: ;tempdns2.tk. IN MX

;; ANSWER SECTION: tempdns2.tk. 1800 IN MX 10 mx.tempdns2.tk.tempdns2.tk.

but the record appears fine on the admin page, the custom.yaml file as well as in the unsigned zone file.

alento-group commented 5 years ago

@JoshData

Ok, the issue is a lack of a trailing dot.

Maybe the message when adding a custom MX record should be:

Enter record in the form of PRIORITY DOMAIN., including trailing period (e.g. 20 mx.example.com.).

with the highlighted part in red? :)

mitchellurgero commented 5 years ago

Along with adding a more clear message on the dashboard, the script can easily check for a trailing period as well:

(Using pseudo code here):

if !newDomainRecord.endswith('.')
    # Warn the user about the trailing dot here. We could auto-append it but we don't want to modify user input in this case.

Or something, very simple.