luser_relay 不转发电子邮件

luser_relay 不转发电子邮件

我正在使用自己的域名 example-mail.com 设置 Postfix + Devecot。

我需要将所有电子邮件地址不在服务器上的传入电子邮件转发到[电子邮件保护]。因此我将下面的几行添加到 /etc/postfix/main.cf,然后重新启动 Postfix。

# unknown_local_recipient_reject_code = 550
luser_relay = [email protected]
local_recipient_maps =_

但是,当我向随机电子邮件地址发送测试电子邮件时,例如[电子邮件保护],我仍然收到自动回复消息:

This is the mail system at host example-mail.com.

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]>: user unknown

并且此消息也不会被转发给[电子邮件保护]

有人知道是什么原因导致此问题吗?我该如何修复此问题?

答案1

你可能不想向前这些邮件(将它们发送到外部地址),但将它们收集到包罗万象邮箱。

在 Postfix 中设置一个 catchall 邮箱

检查您是否正在使用虚拟映射/etc/postfix/main.cf

virtual_alias_maps = hash:/etc/postfix/virtual

如果是,请修改虚拟别名表/etc/postfix/virtual

# local usersuser
[email protected]     heinz
[email protected]      bert 
[email protected]  schwuffi

# catch-all 
@example-mail.com          no-exist

然后通过 激活两者postmap /etc/postfix/virtual && postfix reload

相关内容