我将MySQL,Postfix和PostfixAdmin(https://github.com/postfixadmin/postfixadmin)设置为单独的VM:
sql.example.net - 192.168.99.10 smtp.example.net - 192.168.99.15 admin.example.net - 192.168.99.2 我按照PostfixAdmin的安装说明进行操作,创建了数据库和用户,运行了PA设置,并正确配置了数据库。我可以看到表并在其中添加域和邮箱。但是,当我尝试向smtp.example.net发送电子邮件时,后缀无法传递电子邮件,并引发查找错误,如下所示:
Nov 15 00:23:03 smtp postfix/virtual[1522]: error: open /etc/postfix/sql/mysql_virtual_mailbox_maps.cf: Permission denied Nov 15 00:23:03 smtp postfix/virtual[1522]: error: open /etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf: Permission denied Nov 15 00:23:03 smtp postfix/virtual[1522]: warning: mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf is unavailable. open /etc/postfix/sql/mysql_virtual_mailbox_maps.cf: Permission denied 文件/etc/postfix/sql/mysql_virtual_mailbox_maps.cf如下:
user = postfix password = SMTP_POSTFIX_PASS hosts = sql.example.net dbname = postfix query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1' #expansion_limit = 100 ls -la /etc/postfix/sql/mysql_virtual_mailbox_maps.cf -rw-r--r-- 1 root root 207 Nov 15 00:17 /etc/postfix/sql/mysql_virtual_mailbox_maps.cf ls -la /etc/postfix drwxr-x--- 6 root root 4096 Nov 15 00:29 . drwxr-xr-x 86 root root 4096 Nov 15 00:19 .. -rw-r--r-- 1 root root 99 Nov 15 00:19 dynamicmaps.cf drwxr-xr-x 2 root root 4096 Apr 1 2019 dynamicmaps.cf.d -rw-r--r-- 1 root root 1686 Nov 15 00:19 main.cf -rw-r--r-- 1 root root 27129 Nov 15 00:19 main.cf.proto -rw-r--r-- 1 root root 6208 Nov 15 00:19 master.cf -rw-r--r-- 1 root root 6208 Nov 15 00:19 master.cf.proto -rwxr-xr-x 1 root root 29872 Apr 1 2019 post-install -rw-r--r-- 1 root root 10268 Apr 1 2019 postfix-files drwxr-xr-x 2 root root 4096 Nov 15 00:19 postfix-files.d -rwxr-xr-x 1 root root 11532 Apr 1 2019 postfix-script drwxr-xr-x 2 root root 4096 Apr 1 2019 sasl drw-r--r-- 2 root root 4096 Nov 15 00:19 sql 我可以使用来自smtp.example.net的mysql命令行客户端以用户名:postfix和密码:SMTP_POSTFIX_PASS连接到sql.example.net并在表上运行select命令
mysql -upostfix -p -h sql.example.net postfix MariaDB [postfix]> SELECT maildir FROM mailbox WHERE username='test1@example.net' AND active = '1'; +-------------------+ | maildir | +-------------------+ | example.net/test1/ | +-------------------+ 1 row in set (0.000 sec) /etc/postfix/main.cf:
smtpd_banner = ESMTP relayhost = inet_interfaces = all mynetworks_style = host inet_protocols = ipv4 local_recipient_maps = mydestination = delay_warning_time = 4h unknown_local_recipient_reject_code = 450 maximal_queue_lifetime = 7d minimal_backoff_time = 1000s maximal_backoff_time = 8000s smtp_helo_timeout = 60s smtpd_recipient_limit = 16 smtpd_soft_error_limit = 3 smtpd_hard_error_limit = 12 smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname, reject_invalid_hostname, permit smtpd_sender_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, reject_rbl_client blackholes.easynet.nl smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, permit smtpd_data_restrictions = reject_unauth_pipelining smtpd_helo_required = yes smtpd_delay_reject = yes disable_vrfy_command = yes alias_maps = hash:/etc/postfix/aliases alias_database = hash:/etc/postfix/aliases virtual_mailbox_base = /vmail virtual_mailbox_maps = mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf, mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf virtual_alias_maps = mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf, mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf, mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf virtual_mailbox_domains = mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf virtual_uid_maps = static:150 virtual_gid_maps = static:8 compatibility_level = 2
mysql : Ver 15.1 Distrib 10.3.17-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 postfix : mail_version = 3.4.5 postfixadmin : 3.2 我看不到文件权限的任何问题(如果我对sql文件夹或其中的.cf文件授予较少的限制性权限,则启动时后缀会抱怨此错误)我已确认可以从正在运行的计算机上访问数据库和表后缀,并在Google上搜寻了数小时的高低:(
有人能告诉我我在做什么错吗?
问题来源于stack overflow
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。