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

Postfix - how to set a message ID?

· 52CE 我爱测

I have multiple applications using one Postfix instance connecting through SMTP. Some clients set a message ID and some don't. What I'm trying to do is to let Postfix set its own unique message ID, either for any message it proce…

问题原文

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

I have multiple applications using one Postfix instance connecting through SMTP. Some clients set a message ID and some don't.

What I'm trying to do is to let Postfix set its own unique message ID, either for any message it processes or for those that don't have a message ID set. The final result should be that Postfix sends only messages with message ID.

Can anyone please advise me on how to set a unique message ID using Postfix in order to not send out emails without message IDs anymore?

已采纳解答

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

This is controlled by the always_add_missing_headers setting.

By default Postfix will only do that for clients for which it would rewrite (address) headers anyway. You can enable it unconditionally, but first verify that the messages are not (DKIM)-signed in a way that you want to (but cannot, with added headers) preserve.

Newly generated message IDs will contain your configured hostname (Message-ID: <queueID@myhostname>)


That being said, rather fix/replace the client software instead. If the client cannot be trusted to follow the spec enough to even just generate mandatory headers, who says that by patching up one known issue you are not just more likely missing other interoperability problems that are only evident at certain relays outside your control?

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

资料来源与适用范围

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

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

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