大网数据广告活动
服务器运维问答

SNI for a SMTP server

· 52CE 我爱测

Let's say I have a dedicated server with some IP (IP1). I'm redirecting multiple domains (say example.com , 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 work…

问题原文

原帖链接 · xryl669 · CC BY-SA 4.0

Let's say I have a dedicated server with some IP (IP1). I'm redirecting multiple domains (say example.com, 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 ?

已采纳解答

原帖链接 · Jenny D · CC BY-SA 4.0

SNI is not needed here. The verification of the certificate host name is performed against the hostname returned by the MX record, not the domain name in the target email address. So as long as you have made sure that all the MX records for all your domains point to the same hostname, you only need a certificate for that hostname.

In other words, if you have an MX record stating that all emails to the domain example.com should be handled by the mailserver mail.example.net, then the mailserver needs to have a certificate for the hostname mail.example.net only.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-05-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。