mail: 'my' location is available as mail location

move the reserve domains check to app location validation code
This commit is contained in:
Girish Ramakrishnan
2023-08-01 19:33:59 +05:30
parent 7d929aca54
commit ee836e6646
4 changed files with 28 additions and 14 deletions

View File

@@ -78,14 +78,6 @@ function validateHostname(subdomain, domain) {
const hostname = fqdn(subdomain, domain);
const RESERVED_SUBDOMAINS = [
constants.SMTP_SUBDOMAIN,
constants.IMAP_SUBDOMAIN
];
if (RESERVED_SUBDOMAINS.indexOf(subdomain) !== -1) return new BoxError(BoxError.BAD_FIELD, `subdomain '${subdomain}' is reserved`);
if (hostname === settings.dashboardFqdn()) return new BoxError(BoxError.BAD_FIELD, `subdomain '${subdomain}' is reserved`);
// workaround https://github.com/oncletom/tld.js/issues/73
const tmp = hostname.replace('_', '-');
if (!tld.isValid(tmp)) return new BoxError(BoxError.BAD_FIELD, 'Hostname is not a valid domain name');