policyd-weight(8)
π policyd-weight β the weighted SMTP policy daemon (section 8 of the System Manager's Manual) π
okay bestie, sit down, hydrate, and let's talk about policyd-weight. it's a policy daemon, it lives in section 8 of your system manager's manual, and honestly? it's kind of a big deal. π«Ά
πΈ STATUS πΈ
Beta, and Documentation incomplete. no cap. she's out here doing her thing but the docs are still a work in progress. π
β¨ SYNOPSIS β¨
policyd-weight [-option] [-option2 <arg>] command
π¦ DESCRIPTION π¦
policyd-weight(8) is an SMTP policy daemon written in perl(1) for postfix(1). it looks at RBL/RHSBL results, the HELO and MAIL FROM domain and subdomain arguments, and the client IP address, and then decides how likely it is that this thing is a forgery or straight-up SPAM. it's literally a vibe check for mail. π
it's designed to be called before the SMTP DATA command, at the RCPT TO stage. and the way that this is genius is that it means:
- a) you can reject a mail attempt before the body has even been received π₯
- b) you can 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). yes, a whole account. she needs her own lil home. π
Policyd-weight can operate in master.cf mode or daemon mode:
- in master.cf mode it uses postfix'
spawn(8), which results in a 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. so if you're not a postfix girlie, don't panic β iykyk. π
β SETUP β
π master.cf mode:
master.cf:
master.cf:
policy unix - n n - - spawn user=polw
argv=/usr/bin/perl /usr/local/bin/policyd-weight
main.cf:
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. policyd-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:
main.cf:
smtpd_recipient_restrictions =
permit_mynetworks,
... authenticated permits ...
reject_unauth_destination,
... whitelists, role accounts, clients ...
check_policy_service inet:127.0.0.1:12525
it is possible to have more than one postfix server talk to the daemonized policyd-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. multitasking queen π
β οΈ WARNING β οΈ please note thatcheck_policy_serviceshould come last, or at least afterreject_unauth_destination, or else you may become an open relay. bestie. not the open relay. that is the one thing we are NOT doing today. π
π COMMANDS π
following commands exist and are reserved for daemon mode only:
startβ start the policy serverstopβ stop the policy serverrestartβ restart the policy serverreloadβ tells the policy server to reload its configurationdefaultsβ prints the default settings toSTDOUTand exits
π OPTIONS π
-dβ operate in debug mode Not for use inmaster.cf. in debug mode everything is reported onSTDOUTinstead ofsyslog(3). also an own debug cache daemon will be spawned. the socket-file is named after the value of$SPATHwith".debug"as suffix. πβ¨-f/path/to/fileβ pass a configuration file topolicyd-weight-hβ show help-kβ kill cache daemon Not for use inmaster.cf. together with-dthis kills the debug cache daemon. without-dit kills the global running cache daemon. π-sβ show cache entries Not for use inmaster.cf.-vβ show version
π LOGGING π
logging is done via syslog(3) with facility "mail" and priority "info". for a complete list of log entries and their corresponding configuration parameters refer to policyd-weight.conf(5). receipts live elsewhere, bestie. π§Ύ
π BUGS π
please report bugs to r.felber@ek-muc.de. she's not perfect, she's just a perl girl in a postfix world. π«Ά
π HISTORY π
March 2005 β Ralf Hildebrandt (Author of the Book of Postfix) is the spiritual father of policyd-weight. it was his idea to have a scored RBL evaluation, and I've added the weighted MAIL FROM/HELO DNS-evaluation. for that purpose I used Meng Wong's spf.pl which was shipped with the postfix source as example. origin story? iconic. π
π FILES π
/etc/policyd-weight.conf, Policyd-weight configuration file/etc/postfix/main.cf, Postfix configuration parameters/etc/postfix/master.cf, Postfix daemon processes
π₯ SEE ALSO π₯
policyd-weight.conf(5), Policyd-weight configuration filemaster(5), Postfix master.cf file syntaxpostconf(5), Postfix main.cf file syntaxaccess(5), Postfix SMTP access control table
π LICENSE π
GNU General Public License β free as in freedom, slay as in slay. π
π¦ AUTHOR π¦
Robert Felber <r.felber@ek-muc.de> Autohaus Erich Kuttendreier 81827 Munich, Germany
and that's the whole page, bestie!! written by the one and only for policyd-weight(8), dated Aug 25th, 2006 β from the System Manager's Manual, section 8. go forth, configure responsibly, and do NOT put check_policy_service in the wrong spot. mwah. πβ¨
π¦ where this page comes from
- debian bookworm: policyd-weight 0.1.15.2-12.1 Β· GPL-2.0-or-later
- debian trixie: policyd-weight 0.1.15.2-13 Β· GPL-2.0-or-later
- ubuntu jammy: policyd-weight 0.1.15.2-12 Β· GPL-2.0-or-later
- ubuntu noble: policyd-weight 0.1.15.2-12.1 Β· GPL-2.0-or-later
- ubuntu questing: policyd-weight 0.1.15.2-13
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms