Directadmin mail SNI not working (shared IP)

elco.vanberkel

Verified User
Joined
Mar 6, 2020
Messages
6
Hi,

Currently my users connect to my mailserver via 'mail.servername.nl'. My users are all on 1 shared IP.

Now I have enabled SNI because I want my users to connect via 'mail.userdomain.nl'.

I followed this guide: https://www.directadmin.com/features.php?id=2019

INSTALL cd /usr/local/directadmin
echo mail_sni=1 >> conf/directadmin.conf
service directadmin restart
cd custombuild ./build update
./build set eximconf yes
./build set eximconf_release 4.5
./build set dovecot_conf yes
./build exim_conf
./build dovecot_conf

In dovecot.conf I see "!include conf.d/*.conf".
In /etc/dovecot/conf.d there is "95-sni.conf" with "!include_try /etc/dovecot/conf/sni/*.conf".
In /etc/dovecot/conf/sni/ is "userdomain.nl.conf"

In that file is:

local_name "userdomain.nl mail.userdomain.nl www.userdomain.nl" {
ssl_cert = </usr/local/directadmin/data/users/username/domains/userdomain.nl.cert.combined
ssl_key = </usr/local/directadmin/data/users/username/domains/userdomain.nl.key
}

So everything seems to be installed okay.

Still, when I try to connect with Apple Mail or Outlook it presents the wrong certificate, namely that of mail.servername.nl.
How can I fix this and why isn't this working out of the box?
I use an up-to-date server with Centos 7.
 
Never mind, I found it. It was in Exim. When setting eximconf yes, it doesn't overwrite exim.variables.conf.custom. In that file I set the certificate for all domains to a certificate beloning to mail.servername.nl. I removed that from exim.variables.conf.custom, re-ran ./build exim_conf and now it works. This may be useful for other users.
 
it doesn't overwrite exim.variables.conf.custom.
Correct, that is by design that .custom files will not be overwritten.
If having issues with things (so not only mail), it's important that *any* custom made files are checked. Also like custom scripts and custom webserver configuration and templates which might mess up certain things including things changed (or added) by DA upgrades.
 
Back
Top