警告:mysql:/etc/postfix/mysql_virtual_alias_maps.cf 查找“root”错误。配置远程服务器上数据库的 MySQL 查找时出错

警告:mysql:/etc/postfix/mysql_virtual_alias_maps.cf 查找“root”错误。配置远程服务器上数据库的 MySQL 查找时出错

我遇到了上述警告,但我不知道为什么。同样的配置对另一台服务器运行良好。有人能指导一下吗?Ubuntu 16.04

Sep 16 07:45:34 cs postfix/cleanup[17129]: warning: mysql:/etc/postfix/mysql_virtual_alias_maps.cf lookup error for "root"
Sep 16 07:45:34 cs postfix/cleanup[17129]: warning: 65E41260A77: virtual_alias_maps map lookup problem for root -- message not accepted, try again later
Sep 16 07:45:35 cs postfix/pickup[16899]: warning: 664DD260A77: message has been queued for 1 days

postconf -n

alias_maps = hash:/etc/aliases
allow_percent_hack = no
append_at_myorigin = no
append_dot_mydomain = no
biff = no
canonical_maps = hash:/etc/postfix/canonical
disable_dns_lookups = yes
fallback_relay =
home_mailbox = Maildir/
ignore_mx_lookup_error = yes
local_recipient_maps =
mailbox_size_limit = 0
message_size_limit = 51200000
mydestination = $myhostname, localhost.$mydomain, $mydomain
mydomain = ourdomain.com
myhostname = cs.ourdomain.com
mynetworks = 0.0.0.0/0 [::ffff:127.0.0.0]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relay_domains = $mydestination, ourdomain.com
relayhost = [mail.ourdomain.com]
relocated_maps = hash:/etc/postfix/relocated
sender_canonical_maps = hash:/etc/postfix/sender_canonical
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_client_restrictions = permit_mynetworks permit_inet_interfaces check_client_access hash:/etc/postfix/access
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination
smtpd_sasl_security_options =
smtpd_sender_restrictions = permit_mynetworks check_sender_access hash:/etc/postfix/sender_access reject_unknown_sender_domain warn_if_reject reject_unverified_sender
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
swap_bangpath = no
transport_maps = mysql:/etc/postfix/mysql_transport_mapping.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 5000
virtual_transport = virtual
virtual_uid_maps = static:5000

mysql_virtual_alias_maps.cf

user = postfix
password = password
dbname = postfix
table = alias
select_field = goto
where_field = address
hosts = host_ip

答案1

遇到了同样的问题(虽然是 localhost 服务器)。结果发现在我运行的某个更新中,localhost 从 127.0.0.1 转换为 ::1。在 postfix 中的所有 *.cf 文件中都硬编码了 127.0.0.1(cd /etc/postfix && sed -i 's|localhost|127.0.0.1|g' *.cf)

mysql_virtual_alias_maps.cf

用户 = mail_sql_user

密码 = mail_sql_password

主机 = 127.0.0.1

数据库名称 = 邮件

表 = 别名

select_field = 转到

where_field = 地址

附加条件 = 且 active = '1'

相关内容