[PATCH] Feed myhostname attribute to policy servers

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 ...


Go Back   Usenet Forums > Mail Servers and Related > mailing.postfix.users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-16-2004
Luc Pardon
 
Posts: n/a
Default [PATCH] Feed myhostname attribute to policy servers

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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:16 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0