How to emulate Postfix 3.3 setting "header_from_format" in Postfix 3.1?

0

I'm running Ubuntu 16.04 LTS Server providing Postfix 3.1 and have a setup in which Postfix generates the following From-header for mails:

From: support@example.org (root host.example.net)

The same config on Ubuntu 18.04 LTS Server with Postfix 3.3 generates the following header instead:

From: "root (host.example.net)" <support@example.org>

The first header leads to mail clients showing support@example.org only for mails coming from various different hosts, which makes recognizing individual hosts unnecessary difficult. The second header instead makes the host visible in mail clients.

The different behaviour comes from Postfix 3.3 newly implementing header_from_format with the format I prefer generated by default. Older versions of Postfix don't implement that functionality and I can't find any other setting allowing me to change how From gets rendered like I need it. While there are things like append_at_myorigin, this doesn't seem to be what I need, which is most likely switching the order of things within the header.

So, is there some way to get header_from_format = standard of Postfix 3.3 in Postfix 3.1?

Thanks!

Thorsten Schöning

Posted 2019-04-18T09:12:12.590

Reputation: 523

Answers

0

One can manually change the order of fields of the From-header using some regular expression and "smtp_header_checks":

/^(From:) ([^() ]+@[^() ]+) ((.+))/ REPLACE ${1} "${3}"

https://wiki.4psa.com/display/KB/How+to+change+the+From+header+for+messages+sent+by+Postfix http://www.postfix.org/header_checks.5.html

The important thing to note is that at least in my setup the From-header was initially missing and therefore "header_checks" itself doesn't work, the header is added later during processing only.

Thorsten Schöning

Posted 2019-04-18T09:12:12.590

Reputation: 523