大网数据广告活动
服务器运维问答

Postfix sender_dependent_relayhost_maps: do not relay a specific address

· 52CE 我爱测

Let's say I don't set up relayhost because I want by default to send all the emails by the server itself. Then for some domains in the "FROM", I want to relay to a specific relay. For that I would use a sender_dependent_relayhost…

问题原文

原帖链接 · Simon Levesque · CC BY-SA 3.0

Let's say I don't set up relayhost because I want by default to send all the emails by the server itself.

Then for some domains in the "FROM", I want to relay to a specific relay. For that I would use a sender_dependent_relayhost_maps = hash:/etc/postfix/relay_by_sender and inside it, I would put something like:

@mydomain.com         ses.amazon.com

That is all very straight forward.


Now, what do I put in "relay_by_sender" file to say that I want all my emails relayed for my domain, but one in particular. How would I do that? E.g

@mydomain.com           ses.amazon.com
[email omitted]   null?

Thanks

已采纳解答

原帖链接 · Anderson Medeiros Gomes · CC BY-SA 3.0

In Postfix 2.6 or later, I guess you can return the keyword DUNNO, which is documented in sender_dependent_relayhost_maps topic.

[email omitted]   DUNNO
@mydomain.com           ses.amazon.com

If it doesn't work and you use Postfix 2.7 or newer, I suggest you to replace sender_dependent_relayhost_maps with sender_dependent_default_transport_maps. The latter provides more flexibility:

# /etc/postfix/main.cf
sender_dependent_default_transport_maps = hash:/etc/postfix/relay_by_sender

# /etc/postfix/relay_by_sender
[email omitted]   smtp
@mydomain.com           smtp:[ses.amazon.com]

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-04-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。