This is a discussion on [PATCH] Feed myhostname attribute to policy servers within the mailing.postfix.users forums, part of the Mail Servers and Related category; Some policy servers add headers that show the host that processed the request. An example is SPF, who adds a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Some policy servers add headers that show the host that processed the
request. An example is SPF, who adds a Received-SPF header. If the public host name differs from gethostname() and you want the public name in the header, you have to configure the correct name into the policy server. That seems a waste, since postfix already knows its $myhostname. So I patched 2.2-20041013 to make smtpd pass a "myhostname" attribute along with the other attributes that it sends to the policy server. The patch is at: http://www.skopos.be/downloads/postf...name.patch.txt http://www.skopos.be/downloads/postf...e.patch.tar.gz I made this configurable, e.g. for cases where the policy server does run on a different host. Each policy has its own parameter, same as the <policy>_time_limit, default is: <policy>_myhostname = $myhostname This allows you to control the myhostnames of all the policy servers from the postfix main.cf, even if they're on another box. If you configure an empty value, the myhostname name/attribute is not passed at all and the policy server will do its own thing, as it did before. The patch adds/fixes a few things in src/global and src/util and updates the readme as well. Therefore it has become a little bit bigger than intended, but it's still smallish and - I think - relatively non-intrusive. It does compile ;-) and it seems to work, but I should add that it hasn't seen much exposure under load. I hope this can be rolled into the offical code somehow. I find it really useful and I'd hate to maintain it indefinitely. For those who can't wait and who build from a source RPM, just add the patch to the spec file: Patch22: postfix/postfix-policy-myhostname.patch And in the %setup section: %patch22 -p1 Comments are, of course, welcome. Enjoy, Luc Pardon Skopos Consulting Belgium |