Postfix 配置 - 使用虚拟分钟,但服务器退回我的邮件

Postfix 配置 - 使用虚拟分钟,但服务器退回我的邮件

我没有设置 postfix 的经验,以为 virtualmin 可以帮我完成这项工作。但似乎不行。当我尝试向域发送邮件时([电子邮件保护] [电子邮件保护]或者[电子邮件保护]

我收到以下消息

This is the mail system at host dedq239.localdomain.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<[email protected]> (expanded from <[email protected]>): User
unknown in virtual alias table

Final-Recipient: rfc822; [email protected]
Original-Recipient: rfc822;[email protected]
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; User unknown in virtual alias table

我该如何诊断这里的问题?似乎邮件已到达我的服务器,但服务器无法在本地将邮件传递给正确的用户。(这只是猜测,说实话我不知道发生了什么)。我检查了我的虚拟别名表,它似乎设置正确(如果这有帮助,我可以发帖)。有人能给我下一步的提示吗?

谢谢

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
local_recipient_maps = $virtual_mailbox_maps
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination
smtpd_sasl_auth_enable = yes
soft_bounce = no
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

我的邮件日志文件(最后一条)

    Sep 30 15:13:47 dedq239 postfix/cleanup[7237]: 207C6B18158: message-id=<[email protected]>
    Sep 30 15:13:47 dedq239 postfix/qmgr[7177]: 207C6B18158: from=<[email protected]>, size=1805, nrcpt=1 (queue active)
    Sep 30 15:13:47 dedq239 postfix/error[7238]: 207C6B18158: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=0.64, delays=0.61/0.01/0/0.02, dsn=5.0.0, status=bounced (User unknown in virtual alias table)
    Sep 30 15:13:47 dedq239 postfix/cleanup[7237]: 8DC13B18169: message-id=<[email protected]>
    Sep 30 15:13:47 dedq239 postfix/qmgr[7177]: 8DC13B18169: from=<>, size=3691, nrcpt=1 (queue active)
    Sep 30 15:13:47 dedq239 postfix/bounce[7239]: 207C6B18158: sender non-delivery notification: 8DC13B18169
    Sep 30 15:13:47 dedq239 postfix/qmgr[7177]: 207C6B18158: removed
    Sep 30 15:13:48 dedq239 postfix/smtp[7240]: 8DC13B18169: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[209.85.216.55]:25, delay=1.3, delays=0.02/0.01/0.58/0.75, dsn=2.0.0, status=sent (250 2.0.0 OK 1254348828 36si15082901pxi.91)
    Sep 30 15:13:48 dedq239 postfix/qmgr[7177]: 8DC13B18169: removed
    Sep 30 15:14:17 dedq239 postfix/smtpd[7233]: disconnect from mail-bw0-f228.google.com[209.85.218.228]

下面的 etc.aliases 文件我没有动过这个文件 - myvirtualdomain 是我真实域名的替代品

#  Aliases in this file will NOT be expanded in the header from
#  Mail, but WILL be visible over networks or from /bin/mail.
#
#   >>>>>>>>>>  The program "newaliases" must be run after
#   >> NOTE >>  this file is updated for any changes to
#   >>>>>>>>>>  show through to sendmail.
#

# Basic system aliases -- these MUST be present.
mailer-daemon:  postmaster
postmaster: root

# General redirections for pseudo accounts.
bin:        root
daemon:     root
adm:        root
lp:     root
sync:       root
shutdown:   root
halt:       root
mail:       root
news:       root
uucp:       root
operator:   root
games:      root
gopher:     root
ftp:        root
nobody:     root
radiusd:    root
nut:        root
dbus:       root
vcsa:       root
canna:      root
wnn:        root
rpm:        root
nscd:       root
pcap:       root
apache:     root
webalizer:  root
dovecot:    root
fax:        root
quagga:     root
radvd:      root
pvm:        root
amanda:     root
privoxy:    root
ident:      root
named:      root
xfs:        root
gdm:        root
mailnull:   root
postgres:   root
sshd:       root
smmsp:      root
postfix:    root
netdump:    root
ldap:       root
squid:      root
ntp:        root
mysql:      root
desktop:    root
rpcuser:    root
rpc:        root
nfsnobody:  root

ingres:     root
system:     root
toor:       root
manager:    root
dumper:     root
abuse:      root

newsadm:    news
newsadmin:  news
usenet:     news
ftpadm:     ftp
ftpadmin:   ftp
ftp-adm:    ftp
ftp-admin:  ftp
www:        webmaster
webmaster:  root
noc:        root
security:   root
hostmaster: root
info:       postmaster
marketing:  postmaster
sales:      postmaster
support:    postmaster


# trap decode to catch security attacks
decode:     root

# Person who should get root's mail
#root:      marc
abuse-myvirtualdomain.com: [email protected]

我的 etc/postfix/virtual 文件如下 - 再次用 myvirtualdomain 替换。我认为这个文件是由 Virtualmin 生成的,我尝试过修改它,但没有成功... 这是没有经过我修改的版本。

myunixusername@myvirtualdomain .com myunixusername
myvirtualdomain .com    myvirtualdomain.com
[email protected]  [email protected]
[email protected]   [email protected]
[email protected]  [email protected]
[email protected]   [email protected]

答案1

您需要以某种方式将电子邮件从 admin@ 发送给本地用户(root?)。请注意,它不在您的/etc/aliases或任何其他文件中。

答案2

我认为你的问题在于你的 postfix/main.cf 文件中的“local_recipient_maps”设置

您可以指定允许接收邮件的电子邮件帐户,如果未列出电子邮件地址,则服务器将立即阻止任何请求,我认为这就是您所看到的。

诊断代码:X-Postfix;虚拟别名表中的用户未知

我有这个变量设置如下

local_recipient_maps = $virtual_mailbox_maps virtual_mailbox_maps = hash:/usr/local/etc/postfix/virtual_mailbox_maps

然后 virtual_mailbox_map 文件包含允许的邮箱/别名的所有条目

[电子邮件保护]假的”

来自 postfix/main.cf 文件

完成这些更改后,你需要拥有以下文件

邮政地图 /usr/local/etc/postfix/virtual_mailbox_maps
新别名
# 如果定义了此参数,则 SMTP 服务器将拒绝
# 未知本地用户的邮件。此参数默认定义。

答案3

一些可以尝试采摘的低垂果实:

  1. 你已经为你的 指定了 hash:, virtual_alias_maps但是你运行了吗postmap /etc/postfix/virtual

  2. 输出是什么:postconf local_recipient_maps

  3. 输出是什么:postconf -n

编辑:如果您复制/粘贴了文件,则“myvirtualdomain .com myvirtualdomain.com”会多出一个空格。我不认为这一行应该放在那里。

根据文档,virtual_alias_domains默认为$virtual_alias_maps,但在您的情况下,实际上应该包含 myvirtualdomain.com。您发布的配置并未表明其值。可能:postconf -e "virtual_alias_domains = myvirtualdomain.com" && postfix reload

这有点符合我的理论,你退回电子邮件是因为服务器不接受该域的电子邮件。

以下是解释postfix 的文档

相关内容