I'm trying to understand the structure and how all work together.
Whenever I create a new "website" the following happens (among others):
* Created: /home/mydomain.tld/public_html (OK)
* Created: /home/mydomain.tld/public_html/mail.mydomain.tld (NOT-OK)
* And in DNS Zone Records the following exist:
A mail.mydomain.tld (OK)
A mail.mail.mydomain.tld (NOT-OK)
CNAME www.mail.mydomain.tld mail.mydomain.tld (NOT-OK)
MX mydomain.tld mail.mydomain.tld (OK)
MX mail.mydomain.tld mail.mail.mydomain.tld (NOT-OK)
So:
mail.mydomain.tld is created as a child website. If you write mail.mydomain.tld to your browser you get a welcome page as it has a vHost. As this is a website, it also has a recursive mail.mail.* ...
Is this a bug, is this only related to my server or is it intended to work like this? If it is correct, can someone please explain me why do they exist? If not, how can I correct this?
Thank you in advance...
Comments
Because usually mail clients detect mail.domain.com as hostname while connecting.
Thank you, that explains it.
I know mail.* must be a subdomain. But it should not be served by the web server but dovecot - just saying without knowing the implementation.
In any case, with the current implementation, can I assume the following:
1) I can delete the following without any problems:
A mail.mail.mydomain.tld (NOT-OK)
CNAME www.mail.mydomain.tld mail.mydomain.tld (NOT-OK)
MX mail.mydomain.tld mail.mail.mydomain.tld (NOT-OK)
2) I should write some htaccess to return a "not allowed" code or put an emty index.html
Thank you again...
2. Yes upto you, but you can not delete mail.domain.com from child-domains because if you delete this child-domain its SSL will fail to renew thus causing problems.
Perhaps it is best not to create those extra DNS records during Website creation...
Option - 1 : Send a parameter to the subroutine
...
call createChildDomain(bool blCreateMail)
...
Option - 2 : Hardcoded
...
if (left(strChildDomainName, 5) != "mail.") {
; do create DNS records
...
}
...
https://github.com/usmannasir/cyberpanel/pull/395
https://github.com/istiak101/cyberpanel/commit/a0f2cf9e870c76fc7368286ad2957568b39518b7#diff-8e80ce10f2ad16ff76973b5388eb1096