Dovecot/Postfix 与虚拟用户和 dovecot Passwd-file 的身份验证/权限问题

Dovecot/Postfix 与虚拟用户和 dovecot Passwd-file 的身份验证/权限问题

我目前已将 Postfix/Dovecot 电子邮件服务器配置为运行本地系统帐户(Dovecot auth-system),并且使用 /etc/passwd、/etc/shadow 设置的本地用户一切运行正常。

我想设置此服务器来处理其他域上的其他电子邮件帐户。我能够使用 SNI 设置 Postfix,它似乎在使用本地系统帐户时运行良好。

但是,当我使用虚拟用户设置 Postfix 和 Dovecot 时,我尝试使用 Thunderbird 进行连接,但似乎卡住了。我尝试在 Thunderbird 中重新输入登录凭据(passwd: 和 login: 以我在电子邮件服务器配置中设置的域 1 的用户身份登录),但无济于事。

仅供参考,我在下面的日志文件和配置文件中将测试用户的电子邮件更改为“domain1 上的用户”,并将服务器的域(Postfix SNI)更改为“domain2”(我的本地帐户域)。

当我使用虚拟用户和密码文件数据库重新启动 postfix/dovecot 时,出现以下错误:

dovecot-调试日志

May 01 11:37:01 auth: Debug: client in: CONT<hidden> 
May 01 11:37:01 auth: Debug: passwd-file(user at domain1,50.82.117.87,<AZqfbqT6JIgyUnVX>): Performing passdb lookup
May 01 11:37:01 auth: Debug: passwd-file('user at domain1',50.82.117.87,<AZqfbqT6JIgyUnVX>): Finished passdb lookup 
May 01 11:37:01 auth: Debug: auth('user at domain1',50.82.117.87,<AZqfbqT6JIgyUnVX>): Auth request finished May 01 11:37:03 auth: Debug: client passdb out: FAIL  1  user='user at domain1'   code=temp_fail

dovecot 信息日志

May 01 11:33:35 imap-login: Info: Disconnected: Connection closed (auth service reported temporary failure): user=<'user at domain1'>, method=PLAIN, rip=50.82.117.87, lip=192.168.2.38, TLS, session=<pKmEYaT6kLMyUnVX>

dovecot日志

May 01 11:39:09 auth: Error: passwd-file('user at domain1',50.82.117.87,<GLDmdaT6PoYyUnVX>): open(/etc/dovecot/passwd) failed: Permission denied (euid=115(dovecot) egid=126(dovecot) missing +r perm: /etc/dovecot/passwd, we're not in group 0(root), dir owned by 0:0 mode=0755)

后配置-n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 3.6
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_command =
mailbox_size_limit = 0
message_size_limit = 5120000000
milter_default_action = accept
milter_protocol = 6
mydestination = localhost
myhostname = 'mail.domain2' 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = localhost
non_smtpd_milters = $smtpd_milters
policyd-spf_time_limit = 3600
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_unknown_helo_hostname, check_helo_access hash:/etc/postfix/helo_access
smtpd_milters = local:/opendkim/opendkim.sock
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, check_policy_service unix:private/policyd-spf
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_chain_files = /etc/ssl/acme.sh/'mail.domain2'/privkey.pem, /etc/ssl/acme.sh/'mail.domain2'/fullchain.pem
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_server_sni_maps = hash:/etc/postfix/vmail_ssl.map
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = 'domain1'
virtual_mailbox_limit = 5120000000
virtual_mailbox_maps = hash:/etc/postfix/vmaps
virtual_minimum_uid = 100
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_uid_maps = static:5000

我正在运行 Linux 5.15.0-1027-raspi aarch64 Ubuntu 22.04.2 LTS ext4。Postfix mail_version = 3.6.4 Dovecot 版本 = 2.3.16

我的问题是,我的服务器设置有什么问题?我已阅读 Postfix 和 Dovecot 的虚拟用户文档,并在 Dovecot 中设置了密码文件数据库。我希望继续在 Dovecot 中使用密码文件数据库方案,但在过去一周每天为此工作数小时后,任何建议或建议都会得到认真对待。

提前感谢您提供的任何帮助,如果您需要更多信息,请询问。 -Roy

相关内容