Mail Subdomain added as alias to main domain in httpd.conf

Spirogg

Well-Known Member
Feb 21, 2018
700
163
43
chicago
cPanel Access Level
Root Administrator
Toolkit is installed
has anyone ever checked with the forums at plesk, where toolkit came from. this I agree is weird especially when they offer toolkit and support it.
I do not use WordPress but saw the responses and was not happy for you all. ;(

thanks for your reply
 

slim

Well-Known Member
May 27, 2004
77
8
158
Australia
cPanel Access Level
Root Administrator
Thanks for the long post, but I’m not after complex, non supported work around a - I’m after a fix for what I consider a rather large flaw in cPanel design.
 

Spirogg

Well-Known Member
Feb 21, 2018
700
163
43
chicago
cPanel Access Level
Root Administrator
Thanks for the long post, but I’m not after complex, non supported work around a - I’m after a fix for what I consider a rather large flaw in cPanel design.
is this all cpanel accounts that have WordPress installed, so everyone who has mail.domain.com available for emails and SSL will get duplicate content if they install WP ?
or is this a wsmall amount of cases depending on the cpanel version and wordpress version

really weird that they said they will not fix this? this seems to me to be broken. then?? you offer a product and features then one of the programs you offer create this issue should be looked into as a bug amd fixed, you cant take away a feature customers pay for and say use one or the other. mail.domain.com was part of cPanel for years and then you added toolkit and now this issue with WP sites? something is wrong.

just my 2 cents. I would not be happy either
cant use mail but can use WP cant use WP but can use mail
this is bad SEO as well.
 

Markif

Well-Known Member
Nov 9, 2016
55
7
133
Toulouse
cPanel Access Level
Root Administrator
To complete this complex and unsupported solution ;)
Must be done also for exim for the SMTP service so exim serves the right key-pair as expected by the HELO command in the SMTP exchange.
(have to find again with file does this, will update)
For exim : it is searching his keypairs annonced in the SMTP HELO in
/var/cpanel/ssl/domain_tls/
So the missing (sub)domains can be simply copied there with a script from
/var/cpanel/ssl/apache_tls/
where autossl has created them.
 

Markif

Well-Known Member
Nov 9, 2016
55
7
133
Toulouse
cPanel Access Level
Root Administrator
PS : by the way autoSSL actually works, it *needs* a web access on the hostname for witch it is creating a certificate : that the way it does the (minimum) verification.
So at least at the moment that the autoSSL script runs, this web access must be someway available....
But if web access must be completely be avoided at all, it is still possible to pay for a DV-certificate, and validate it by with the third party provider via email or DNS entries.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,474
2,604
363
cPanel Access Level
Root Administrator
Do many customers even use "mail.domain.com" anymore? The mail client doesn't care what domain you're connecting to as long as there is an SSL in place.

Just so I'm clear on what we're looking for - we want mail.domain.com to get secured with AutoSSL in dovecot and other mail tools, but *don't* want there to be an Apache alias/vhost/entry of any kind to ensure it doesn't load from a browser. Is that correct?
 

tss

Member
Aug 22, 2011
16
4
53
@cPRex:

Nobody answered, but I will. Yes!

Finally saw this in action when using httrack to download a CMS domain so that I could make it static. Of course I've been using the "mail" subdomain for almost 20 years because it's always been part of the cPanel docs, and of course I'm using using it for SNI with AutoSSL with Sectigo certs. cPanel STILL lists it in the configuration email sent to clients. Email is as large a part of my hosting business as web sites; for small business they're quite connected.

Having the main domain visible at "mail.domain.com" IS bad news.

So the solution now is to just make a single MX on the main domain and drop the "mail" subdomain completely? That's fine for new domains, but not for clients you''ve had for 10 years or more with a slew of email accounts...
 
  • Like
Reactions: cPRex

pendias

Member
Oct 11, 2014
12
3
53
cPanel Access Level
Root Administrator
Hello,

Donno if it helps, but you can simply add the following code to the .htaccess of the main website. This will stop the subdomain showing the main website content, and instead will show the cpanel default page.
===============
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mail\.yourdomain\.com$ [NC]
RewriteRule ^$ /cgi-sys/defaultwebpage.cgi [L]
===============
 
  • Like
Reactions: cPRex