后缀 - 状态=退回(未知用户“myuser”)

时间:2013-08-22 10:23:13

标签: linux postfix-mta

我正在配置Postfix,当通过telnet和SMTP验证时,我收到状态退回错误,未知用户:

错误日志

  

postfix / local [18718]:4590D7DC0A51:to =,relay = local,delay = 9.8,delays = 9.8 / 0.01 / 0 / 0.04,dsn = 5.1.1,status = bounced(unknown user:“myuser”)

“myuser”已存在,但具有完整域名:myuser@mydomain.com。

用户验证

 postmap -q myuser@mydomain.com mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf

输出为:“1” - 所以我猜它没问题。

我的后缀配置

root# postconf -n:
append_at_myorigin = yes
biff = no
config_directory = /etc/postfix
default_destination_concurrency_limit = 1
delay_warning_time = 8h
disable_vrfy_command = yes
dovecot_destination_concurrency_limit = 1
dovecot_destination_recipient_limit = 1
enable_original_recipient = yes
local_destination_concurrency_limit = 1
maximal_queue_lifetime = 6d
mydestination = mydomain.com
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated
smtpd_delay_reject = no
smtpd_hard_error_limit = 10
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, reject_invalid_hostname
smtpd_recipient_restrictions = permit_mynetworks, reject_unknown_sender_domain,             reject_unknown_recipient_domain, reject_unlisted_recipient, reject_unauth_destination, reject_unauth_pipelining
smtpd_sender_restrictions = permit_mynetworks, reject_unknown_sender_domain
smtpd_soft_error_limit = 5
strict_rfc821_envelopes = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot

感谢您的帮助。

4 个答案:

答案 0 :(得分:99)

您已添加mydestination = mydomain.com,因此mydomain.com的有效用户将在local_recipient_maps中进行搜索。从日志中可以清楚地看出,local传递代理被选中来传递邮件,因为本地域类匹配。有关更多帮助,请参阅postfix address classes

修改你的main.cf,如下所示

#/etc/postfix/main.cf
mydestination = 
# set to localhost localhost.$mydomain or remove mydomain.com for now
# Ensure that postmap -q mydomain.com mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf is returning mydomain.com and 
# postmap -q myuser@mydomain.com mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf succeeds

答案 1 :(得分:1)

在/var/postfix/main.cf中使用以下设置

myorigin = localhost
myhostname = <your_host_name>
mydestination = localhost.$mydomain, localhost, localhost.localdomain

其次:

sudo postmap /etc/postfix/virtual
sudo service postfix restart

答案 2 :(得分:0)

对于其他人,当我设置mydestination = mydomain.com时。 Postfix显示警告不要在mydestination和virtual_mailbox_domains中都列出域mydomain.com。所以我将其设置为relayhost = mydomain.com

我的postfix版本:3.1.0(postconf -d | grep mail_version)

答案 3 :(得分:0)

打开/etc/postfix/main.cf,查找mydestination字段,并将其值更改为下面的值

mydestination = localhost, localhost.localdomain

别忘了之后再运行sudo postfix reload