You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Postfix+Dovecot部署后Geary创建邮箱失败,Dovecot认证失败排查求助

Postfix+Dovecot部署后Geary创建邮箱失败,Dovecot认证失败排查求助

大家好,我在Ubuntu Server 22.04(VMware Workstation 16虚拟机)上部署了Postfix+Dovecot邮件服务,然后在Ubuntu 22.04 Desktop上用Geary邮件客户端创建新邮箱时,一直提示“Account not created: check your sending server details”。查看服务器的/var/log/mail.log,发现了认证失败的日志,具体内容如下:

Jan 19 16:40:17 mailserver dovecot: imap-login: Disconnected: Connection closed (auth failed, 1 attempts in 4 secs): user=<obfuscated>, method=PLAIN, rip=192.168.0.220, lip=192.168.0.212, session=<JX+MEp7ymNTAqADc>

先说明下基础信息:

  • 服务器主机名:mailserver.example.com
  • 测试用户邮箱:obfuscateduser@example.com
  • 未启用SSL/TLS加密

下面是我当前的各个配置文件内容,麻烦帮忙看看哪里出问题了:

Dovecot相关配置

/etc/dovecot/conf.d/10-mail.conf

mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_location = maildir:~/Maildir
mail_privileged_group = mail

注:这里我写了两个mail_location,应该是最后一行的Maildir生效,但不确定会不会影响认证?

/etc/dovecot/dovecot.conf

protocols = imap lmtp

/etc/dovecot/conf.d/10-master.conf

service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
mode = 0600
user = postfix
group = postfix
}
}

service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
}

注:原配置里我不小心把service auth写成了ervice auth,已经修正过来了,不确定之前的笔误会不会有影响

/etc/dovecot/conf.d/10-auth.conf

disable_plaintext_auth = no
auth_username_format = %n
auth_mechanisms = plain login

Postfix配置(/etc/postfix/main.cf)

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
readme_directory = no
compatibility_level = 3.6

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level=may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mailserver.tne.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, example.com, mailserver.example.com, localhost.example.com, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
message_size_limit = 52428800
mailbox_transport = lmtp:unix:private/dovecot-lmtp
smtputf8_enable = no

注:这里myhostname设置的是mailserver.tne.com,但实际服务器名称是mailserver.example.com,不确定这个不一致是否会导致问题?

服务器端口扫描结果(nmap)

PORT    STATE  SERVICE
22/tcp  open   ssh
25/tcp  open   smtp
80/tcp  open   http
110/tcp closed pop3
143/tcp open   imap
443/tcp closed https
465/tcp closed smtps
587/tcp open   submission
993/tcp closed imaps
995/tcp closed pop3s

另外,我感觉可能需要补充用户相关的配置信息,但不知道具体应该看哪个文件,麻烦各位大佬帮忙排查下认证失败的原因,谢谢!

备注:内容来源于stack exchange,提问作者Ilya Shmadchenko

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 15:12:48