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

Mail server: Does /etc/mailname have to match SSL certificate CN?

· 52CE 我爱测

I set up a web and email server on a VPS that uses apache2 with multiple virtual hosts and postfix, dovecot, and roundcube for the email server. I am getting an authentication failure when trying to send mail using roundcube, and…

问题原文

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

I set up a web and email server on a VPS that uses apache2 with multiple virtual hosts and postfix, dovecot, and roundcube for the email server. I am getting an authentication failure when trying to send mail using roundcube, and I am thinking it might have to do with a mismatch between /etc/mailname (host.vpshoster.com) and the SSL certificate which was registered for one of the virtual hosts (www.example.com). Do they have to match?

已采纳解答

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

The authentication error was not a direct result of the mismatch between /etc/mailname and the common name (CN) on the SSL certificate, it was due to misconfiguration of the mail server; however, once I got the mail server working the CN mismatch did cause security warnings when I sent an email to a gmail account. I created a new SSL certificate so the CN matched /etc/mailname and the security warnings related to this issue went away (although I am still receiving security warnings related to the message not being encrypted).

Lesson learned: the CN on the SSL certificate used by the email server should match the name of the email server as opposed to the name of a virtual host hosted on the same machine as the email server (I included the email server and all of my virtual hosts on the same SSL certificate, but listed the email server first to get the CN set correctly).

EDIT:

In addition to the lesson learned about the original question, I also learned the following during the process of setting up my mail server:

  1. "Additionally for some mail services like gmail - you need to have reverse DNS set up on your mail server's IP and that name also needs to match the mailname" -ivanivan

  2. I had a reverse DNS PTR record for my IPv4 address, but my IPv6 PTR record was wrong and I had to update it. In fact, without the proper PTR record, the emails I sent to gmail were not being delivered at all. They were returning to sender with information about IPv6 sending guidelines.

  3. The mail was still unencrypted. See Outgoing email not encrypted for my postfix configuration and how I resolved the encryption issue.

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

资料来源与适用范围

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

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

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