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

Postfix: How to prepend a header only once?

· 52CE 我爱测

I want to prepend a header with postfix to every outgoing mail from a specific domain. At the moment i use: check_sender_access hash:/etc/postfix/prepend with /etc/postfix/prepend: my.domain PREPEND Header: value this works quite…

问题原文

原帖链接 · allo · CC BY-SA 3.0

I want to prepend a header with postfix to every outgoing mail from a specific domain. At the moment i use:

check_sender_access hash:/etc/postfix/prepend

with /etc/postfix/prepend:

my.domain PREPEND Header: value

this works quite nice, but when i send a e-mail to several recipients, then the header is added multiple times, one for each recipient, to each of the outgoing mails.

so when i send a mail to 4 persons, each of them receives a mail, which contains the header 4 times.

已采纳解答

原帖链接 · Stefan Förster · CC BY-SA 3.0

There is no "simple" solution for this. You need to define a second smtpd instance in master.cf, have it access it's own cleanup instance, and define a header_checks maps for this cleanup instance. Then, you'd prepend the header on some unique header present in that mail, i.e. message-id.

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

资料来源与适用范围

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

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

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