I all, my first post on here, I have a ISPConfig managed VPS where I host multiple web and e-mail domains. My DNS and name-servers are hosted at Cloudfare The good news - everything works I need to config my e-mail domains so that when the customer sets up his mail client he uses e.g mail.hisdomain.com and not my mail server host domain e.g ms1.serverflex.co.za. Currently IMAP and SMTP only works if I use ms1.serveflex.co.za I have tried all ways of DNS work around. Please help
That's not recommended as it would mean that all subdomains must be in the central SSL cert of the server. So such a setup works only if you have very few customers and do not plan to grow. You can find such a setup here: https://www.howtoforge.com/securing...server-with-a-valid-lets-encrypt-certificate/ The better approach, though, is what larger hosters do and what is the default in ISPConfig: You tell your customers to connect to a subdomain of your domain (e.g. mail.yourdomain.tld) and not their domain to connect to email. This will give you a more stable setup, your service can grow, the SSL cert renewal will not fail if a customer changes his DNS, and it will also strengthen your company's branding as a service provider.
In most cases the Mailclient itself tries to determine the server settings. Allthough there is no built-in way with ISPConfig you can acchieve this with some other software. This is what most customers want anyway, they just want to enter the E-Mailaddress and password in the client and everything else should happen automatically. email-autoconf is one example https://gitlab.com/onlime/email-autoconf
See https://forum.howtoforge.com/threads/how-should-my-end-users-connect-to-my-e-mail-services.88472/ as well.
the OP's original plan can be done using SNI, both postfix and pure-ftpd fully support SNI now, so it should be possible to do this for both emails and ftp access. each domain would have it's own certificate, so no problem with having lots of domains and using letsencrypt. the only issue is it would currently have to be configured manually. ispconfig doesn't support it at the moment. it would be nice if it was supported configuration option in ispconfig, but that would be quite a bit of work, i expect the certificates would have to be stored in the db and passed between servers via mysql to allow for multi-server systems where the services for each domain are separated across different servers.
Yes, ISPConfig would need a complete new cert management that allows certs to be created independently from websites, and they must be stored in the database.