Postfix 可以接收但不能发送外部邮件(未知用户)

Postfix 可以接收但不能发送外部邮件(未知用户)

我的 postfix/dovecot 配置在 Ubuntu 18.04 上运行,在本地运行良好。此外,我的 dovecot 可以接收来自外部邮件的邮件(例如,[电子邮件保护]可以接收来自 gmail 地址的邮件)。

但是当我尝试向外部发送邮件时(此处[电子邮件保护]),我遇到了这个错误:

May 17 11:53:42 vpsgauthier dovecot: auth-worker(4395): Debug: sql([email protected]): query: SELECT email as user, password FROM virtual_users WHERE email='[email protected]'
May 17 11:53:42 vpsgauthier dovecot: auth-worker(4395): sql(ausername): unknown user
May 17 11:53:42 vpsgauthier dovecot: auth: Debug: userdb out: NOTFOUND#0111
May 17 11:53:42 vpsgauthier postfix/pipe[4405]: 3390F12D3: to=<[email protected]>, relay=dovecot, delay=0.16, delays=0.06/0.04/0/0.05, dsn=5.1.1, status=bounced (user unknown)

看起来 Postfix 会将邮件发送到 Dovecot,而 Dovecot 会在虚拟用户内部搜索用户“[电子邮件保护]",而不是将请求发送到google的MX。

但是,请问我该如何改变这种情况呢?

这是我的 /etc/postfix/main.cf:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

milter_default_action = accept
milter_protocol = 6
smtpd_milters = inet:localhost:12345
non_smtpd_milters = inet:localhost:12345

#https://blog.tjitjing.com/index.php/2012/03/guide-to-install-opendkim-for-multiple-domains-with-postfix-and-debian.html

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_minimum_uid = 100
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

你能帮我吗?

相关内容