我有 Ubuntu Server 22.04、Postfix、Dovecot、MariaDB 和 Roundcube Webmail。我创建了两个邮箱:[电子邮件保护]和[电子邮件保护]。如果我尝试向对方或自己发送消息,我会收到错误:“ SMTP Error (550): Failed to add recipient… (5.1.1…: Recipient address rejected: User unknown in virtual alias table)
。”
在 /var/log/mail.log 中我看到了警告
“postfix/trivial-rewrite[113120]: warning: do not list domain epam.tr in BOTH virtual_alias_domains and virtual_mailbox_domains”.
当然,我已经用 Google 搜索过它并检查了 postconf 参数。
ilya@relay:~$ postconf mydestination virtual_mailbox_domains virtual_alias_domains
mydestination = localhost.$mydomain, localhost, localhost.localdomain
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_domains = $virtual_alias_maps
以及这些文件的内容
/etc/postfix/mysql_virtual_domains_maps.cf
user = postfix
password = 123
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%u'
/etc/postfix/mysql_virtual_alias_maps.cf
user = postfix
password = 123
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%u'
myorigin
另外,我已经注释掉了中的选项/etc/postfix/main.cf
,但还是没有帮助。我认为 postfix 配置中的域名或主机名有错误,但我无法发现它。
ilya@relay:~$ hostname --fqdn
relay.epam.tr.local
完整的 postconf 输出是
ilya@relay:~$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 3.6
dovecot_destination_recipient_limit = 1
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
mydestination = localhost.$mydomain, localhost, localhost.localdomain
mydomain = epam.tr.local
myhostname = relay.epam.tr.local
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
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 ESMTP $mail_name (Ubuntu)
smtpd_helo_required = yes
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/mail/public.pem
smtpd_tls_key_file = /etc/ssl/mail/private.key
smtpd_tls_security_level = may
smtpd_use_tls = yes
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:1024
virtual_mailbox_base = /home/mail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 1024
virtual_transport = dovecot
virtual_uid_maps = static:1024
关于代理映射:
Aug 29 10:21:33 relay postfix/trivial-rewrite[118618]: warning: dict_proxy_lookup: service proxymap: Connection reset by peer