首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Dovecot返回localhost.localdomain证书

Dovecot返回localhost.localdomain证书
EN

Server Fault用户
提问于 2018-05-20 06:02:07
回答 1查看 1K关注 0票数 1

我在Ubuntu16.04中的Postfix+Dovecot配置有问题。我可以配置我的邮箱,我可以正确地发送和接收电子邮件,现在我想设置POP3+IMAP。

我遇到的问题是,当我连接时,我总是得到错误的证书

代码语言:javascript
运行
复制
root@server:~# openssl s_client -connect server:993 #with or without servername parameter
CONNECTED(00000003)
depth=0 CN = localhost.localdomain
verify return:1
---
Certificate chain
 0 s:/CN=localhost.localdomain
   i:/CN=localhost.localdomain

然后,它不会返回/etc/dovecot/conf.d/etc/10-ssl.conf中配置的证书。在这个文件中,我指定了ssl、ssl_cert、ssl_key、ssl_key_password和verbose_ssl。为了构建证书,我将"example.com“crt、CA包和密钥连接在同一个文件中。

所使用的证书用于"example.com“(没有子域),我将服务器/etc/postfix/main.cf配置为将"example.com”作为myhostname和mydestination字段。我的MX记录也指向"example.com“。

机器的主机名是"server“。

日志中唯一奇怪的消息是:

代码语言:javascript
运行
复制
May 20 01:33:47 server dovecot: lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
May 20 01:33:47 server dovecot: lda(root): Error: chdir(/root) failed: Permission denied
May 20 01:33:47 server dovecot: lda(root): Error: User initialization failed: Namespace '': stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
May 20 10:58:47 server dovecot: lda: Fatal: Invalid user settings. Refer to server log for more information.
May 20 01:33:47 server dovecot: lda: Fatal: Invalid user settings. Refer to server log for more information.
May 20 09:26:07 server postfix/smtpd[23663]: warning: cannot get RSA certificate from file "/etc/ssl/certs/mail_with_key_creationbyte_com.crt": disabling TLS support
May 20 09:26:07 server postfix/smtpd[23663]: warning: TLS library problem: error:140DC009:SSL routines:SSL_CTX_use_certificate_chain_file:PEM lib:ssl_rsa.c:708:

根文件夹已经具有root:root 0700权限。

有哪些命令可以用来调试吗?我不知道如何决定提供哪一份证书。

EN

回答 1

Server Fault用户

发布于 2018-05-21 05:15:04

这里有几个问题:

10-ssl.conf文件被更高的数字: /etc/dovecot/conf.d/99-mail-stack-delivery.conf所取代。

因此,无论我在10-ssl.conf中输入了什么,它总是返回在99邮件堆栈中配置的默认值。mail(默认证书是localhost.localdomain)。

我也指错了港口。我需要使用143端口

我在证书上遇到的错误是因为cat命令的格式是这样的

然后,postfix配置文件中的SMTP证书与在99邮件堆栈交付中指定的证书之间有区别。config在postfix中使用加密密钥文件配置它,但是SMTP不允许加密密钥。因此,我必须指向后缀配置中的未加密密钥。

希望所有这些信息能帮助像我这样的新手安装电子邮件服务器。

我使用的最有用的工具是:

代码语言:javascript
运行
复制
# summary and validation of all config
dovecot -n  

# errors and verbosing
tail -f /var/log/dovecot.log   

openssl s_client -connect example.com:143 -servername example.com -starttls imap
openssl s_client -connect example.com:143 -servername example.com -starttls imap

使用这2,您可以检查您的证书和服务是否有效。

检查电子邮件队列:mailq command

检查~/Maildir{cur,new }文件夹存在并具有正确的权限(youruser:youruser 0700)

打开Outlook日志记录:文件->选项->高级->其他->启用故障排除日志记录。日志将在AppData\Local\Temp\Outlook日志记录中

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/912974

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档