我在 ubuntu 20.04 服务器上运行 postfix。我尝试修复 /var/log/mail.err 文件中的某些警告,但收到以下信息:
Aug 9 09:34:45 mail postfix/proxymap[281260]: error: open /etc/postfix/sql/mysql_virtual_domains_maps.cf: Permission denied
Aug 9 09:36:49 mail postfix/proxymap[282230]: error: open /etc/postfix/sql/mysql_virtual_alias_maps.cf: Permission denied
Aug 9 09:36:49 mail postfix/proxymap[282230]: error: open /etc/postfix/sql/mysql_virtual_alias_domain_maps.cf: Permission denied
Aug 9 09:36:49 mail postfix/proxymap[282230]: error: open /etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf: Permission denied
Aug 9 09:36:49 mail postfix/proxymap[282230]: error: open /etc/postfix/sql/mysql_virtual_domains_maps.cf: Permission denied
Aug 9 10:25:49 mail postfix/proxymap[304446]: error: open /etc/postfix/sql/mysql_virtual_alias_maps.cf: Permission denied
Aug 9 10:27:49 mail postfix/proxymap[304446]: error: open /etc/postfix/sql/mysql_virtual_alias_domain_maps.cf: Permission denied
Aug 9 10:27:49 mail postfix/proxymap[304446]: error: open /etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf: Permission denied
Aug 9 10:27:49 mail postfix/proxymap[304446]: error: open /etc/postfix/sql/mysql_virtual_domains_maps.cf: Permission denied
在我的 /var/log/mail.log 文件中我得到:
Aug 9 10:53:49 mail postfix/proxymap[304446]: warning: mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf is unavailable. open /etc/postfix/sql/mysql_virtual_alias_maps.cf: Permission denied
Aug 9 10:53:49 mail postfix/cleanup[306706]: warning: proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf lookup error for "[email protected]"
Aug 9 10:53:49 mail postfix/cleanup[306706]: warning: 359E0123381: virtual_alias_maps map lookup problem for [email protected] -- message not accepted, try again later
Aug 9 10:53:49 mail postfix/pickup[282225]: 36D3B123381: uid=997 from=<netdata>
Aug 9 10:53:49 mail opendmarc[1127]: ignoring connection from localhost
Aug 9 10:53:49 mail postfix/cleanup[306428]: 36D3B123381: message-id=<[email protected]>
Aug 9 10:53:49 mail postfix/proxymap[304446]: warning: mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf is unavailable. open /etc/postfix/sql/mysql_virtual_alias_maps.cf: Permission denied
Aug 9 10:53:49 mail postfix/cleanup[306428]: warning: proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf lookup error for "[email protected]"
Aug 9 10:53:49 mail postfix/cleanup[306428]: warning: 36D3B123381: virtual_alias_maps map lookup problem for [email protected] -- message not accepted, try again later
输出如下:
namei -l /etc/postfix/sql/mysql_virtual_domains_maps.cf
f: /etc/postfix/sql/mysql_virtual_domains_maps.cf
drwxr-xr-x root root /
drwxr-xr-x root root etc
drwxr-xr-x root root postfix
drwxr-xr-x root root sql
-rw-r-x--- root root mysql_virtual_domains_maps.cf
这里到底可能是什么问题?我该如何调试并修复它?
答案1
正如预期的那样,您的 postfix 用户没有权限读取配置文件。
sudo chmod o+r /etc/postfix/sql/*
或者,如果你不希望其他用户阅读这些文件
sudo chown :postfix /etc/postfix/sql/*
附注:您实际上并不需要此处的组的可执行位:
sudo chmod g-x /etc/postfix/sql/*