Let's say I have a dedicated server with some IP (IP1). I'm redirecting multiple domains (say
example.net) to that IP via DNS.
I've a single nginx server running here, and I've set up SNI correctly here and it works for HTTPS.
I've also set up MX for both domain to point to server. I've set up a SMTP server listening and it's responding correctly on port 25 by deducing the allowed host from the email address and rejecting any other host's emails.
I've set up TLS for this server but it only allows a single SSL certificate (either for
example.com or for
example.net). Is there a way, with SMTP, to use SNI (or an equivalent ?) so that, depending on which destination it present the right TLS certificate ?
So far, I haven't found anything for this. My current strategy is to either use a different IP for the different domain (might be possible with IPv6, but not for IPv4 in my case) and run two SMTP servers (one for each host) and a firewall rule to redirect to the different port based on destination IP. This is cumbersome for 2 domains, but if you have more domains, let's say 10 domains, it's not viable at all.
Is there a better strategy ? How do large service providers deals with SMTP for numerous hosts ?