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

How can I configure postfix to allow relay for one specific recipient/destination email address?

· 52CE 我爱测

My postfix install denies relaying. But I'd like to configure it to make an exception for one specific destination address or a specific domain? For example, allow relaying of all messages from anyone destined for [email omitted]…

问题原文

原帖链接 · rvh · CC BY-SA 4.0

My postfix install denies relaying. But I'd like to configure it to make an exception for one specific destination address or a specific domain?

For example, allow relaying of all messages from anyone destined for [email omitted] or @example.com, but continue to deny relaying for all other cases.

How would that exception be configured in postfix?

已采纳解答

原帖链接 · rvh · CC BY-SA 4.0

some trial and error but finally figured this out.

tested and confirmed on postfix versions 2.10.1 and 3.4.13.

start with a postfix server that blocks all relays.

to allow relaying for one specific recipient address, such as [email omitted], create a file like, /etc/postfix/relay_recipients.

in the file add the line: [email omitted] x

then create a lookup table using this command:

postmap /etc/postfix/relay_recipients

then in main.cf add:

relay_domains = example.com
relay_recipient_maps = hash:/etc/postfix/relay_recipients

restart postfix.

now postfix will continue to block all relays, except when the recipient email address is [email omitted].

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

资料来源与适用范围

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

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

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