/etc/postfix/master.cf:
sendercheck unix - n n - - spawn
user=nobody argv=/etc/postfix/policy/sender_check.pl
http://www.postfix.org/SMTPD_POLICY_README.html#client_config says:
To create a policy service that listens on a UNIX-domain socket
called "policy", and that runs under control of the Postfix spawn(8)
daemon, you would use something like this:
1 /etc/postfix/master.cf:
2 policy unix - n n - 0 spawn
3 user=nobody argv=/some/where/policy-server
4
5 /etc/postfix/main.cf:
6 smtpd_recipient_restrictions =
7 ...
8 reject_unauth_destination
9 check_policy_service unix:private/policy
10 ...
11 policy_time_limit = 3600
NOTES:
* Lines 2, 11: the Postfix spawn(8) daemon by default kills
its child process after 1000 seconds. This is too short for
a policy daemon that may need to run for as long as the SMTP
server process that talks to it. The default time limit is
overruled in main.cf with an explicit "policy_time_limit"
setting. The name of the parameter is the name of the master.cf
entry ("policy") concatenated with the "_time_limit" suffix.
See spawn(8) for more information about the time limit
parameter.
And replace policy_time_limit by the name that corresponds
to your sender check.
Wietse