policyd-weight8
Weighted smtp policy daemon
Usage
policyd-weight [-option]
[-option2
<arg>]
command
Status
Beta, Documentation incomplete
Overview
policyd-weight(8) is a SMTP policy daemon written in perl(1) for postfix(1). It evaluates based on RBL/RHSBL results, HELO and MAIL FROM domain and subdomain arguments and the client IP address the possibility of forgery or SPAM. It is designed to be called before the SMTP DATA command at the RCPT TO stage. This way it is a) possible to reject a mail attempt before the body has been received and b) to keep multirecipient mail intact, i.e. provide the functionality of selective usage based on recipients.
To make policyd-weight(8) work with postfix(1), it is required to add a system account for $USER (default: polw)
Policyd-weight can operate in master.cf or daemon mode. In master.cf mode it uses postfix' spawn(8), which results in number of simultaneous requests perl instances. In daemon mode it uses shared memory and forks on load, and only if all child processes are busy.
At the time of writing the man-pages for policyd-weight assume a postfix installation. It has been reported that policyd-weight works with other MTAs like Exim, too.
Setup
master.cf mode:
master.cf:-
policy unix - n n - - spawn user=polw
argv=/usr/bin/perl /usr/local/bin/policyd-weight
main.cf:-
smtpd_recipient_restrictions =
permit_mynetworks,
... authenticated permits ...
reject_unauth_destination,
... whitelists, role accounts, clients ...
check_policy_service unix:private/policy
daemon mode:
start the daemon with policyd-weight start. Poliyd-weight then listens on $TCP_PORT (default: 12525) for policy requests. To make postfix talk to that port do following changes to main.cf:
main.cf:-
smtpd_recipient_restrictions =
permit_mynetworks,
... authenticated permits ...
reject_unauth_destination,
... whitelists, role accounts, clients ...
check_policy_service inet:127.0.0.1:12525It is possible to have more than one postfix server talk to the
daemonizedpolicyd-weight by configuring each postfix machine to query the policy server with check_policy_service inet:IP:12525 where IP is the host on which policyd-weight runs.Please note that
check_policy_serviceshould come at last, or at leastafterreject_unauth_destination, or else you may become an open relay.
Commands
Following commands exist and are reserved for daemon mode only:
startstart the policy server
stopstop the policy server
restartrestart the policy server
reloadtells the policy server to reload its configuration
defaultsprints the default settings to STDOUT and exits
Options
-doperate in debug mode-
Not for use in master.cf. In debug mode everything is reported on STDOUT instead of syslog(3). Also an own debug cache daemon will be spawned. The socket-file is named after the value of $SPATH with ".debug" as suffix.
-
-f /path/to/file -
Pass a configuration file to policyd-weight
-hshow help
-kkill cache daemon-
Not for use in master.cf. Together with
-dthis kills the debug cache daemon. Without-dit kills the global running cache daemon.
-sshow cache entries-
Not for use in master.cf.
-vshow version
Logging
Logging is done via syslog(3) with facility "mail" and priority "info". For a complete list of log entries and their correspondending configuration parameters refer to policyd-weight.conf(5).
Files
/etc/policyd-weight.conf, Policyd-weight configuration file /etc/postfix/main.cf, Postfix configuration parameters /etc/postfix/master.cf, Postfix daemon processes
Releases
10 releases since Debian 4.0 (Etch); the text changed 3 times.