小编puf*_*uff的帖子

如何配置 postfix 只发送到白名单地址?

我想将 postfix 配置为仅将邮件发送到白名单中的地址。我曾尝试使用smtpd_recipient_restrictionsmain.cf像这样:

smtpd_recipient_restrictions =
    reject_unauth_destination
    check_recipient_access hash:/path/to/whitelist
Run Code Online (Sandbox Code Playgroud)

白名单文件格式为

address@example.com    OK
another@example.com    OK
Run Code Online (Sandbox Code Playgroud)

然后用postmap命令翻译成散列。

尽管如此,中继仍将邮件发送到非白名单地址。我错过了什么?

编辑:我通过sendmail命令发送这封邮件,这显然绕过了 smptd 限制。有没有办法处理这个问题?

编辑 2/故事的其余部分:我花了很多时间尝试通过 SMTP 发送 sendmail 只是为了发现我使用的命令不是 sendmail,而是 postfix 的 sendmail 兼容接口,它模仿了功能但不能告诉据我所知,使用 SMTP。

不过 84104 的解决方案运行良好。

postfix whitelist

8
推荐指数
1
解决办法
9836
查看次数

标签 统计

postfix ×1

whitelist ×1