policy-spf.peruser(5)
π NAME π
policyd-spf β the python per-user configuration situation, aka how to give specific recipients their own lil SPF rules β¨
This is the manual page for policy-spf.peruser(5), filed under File Formats Manual, and bestie it is so much less scary than it sounds π«Ά
πΈ VERSION πΈ
3.1.0
(periodt. that's the one we're talking about.)
π USAGE π
Usage:
policyd-spf [/etc/policyd-spf/policyd-spf.conf]
π¦ OTHER DOCUMENTATION π¦
Okay so before you read this, the docs are assuming two things about you: that you've already read Postfix's README_FILES/SMTPD_POLICY_README, and that you're generally familiar with Sender Policy Framework (SPF). If you need the full lore on SPF, go read RFC 7208 π
man 1 policyd-spf is where the general operation documentation for this package lives.
And man 5 policyd-spf.conf is your girl for configuration file info. Go read her.
β¨ SYNOPSIS β¨
python-policyd-spf ships with a default installed configuration file and a whole set of default configuration options, and those defaults are what get used if the configuration file can't be found. You can change all of that by editing the installed configuration files, or by handing it a path to an alternate configuration file π₯
And on top of that β the main character feature β you can provide different configurations on a per user basis. This man page is all about setting up and using per user (mail recipient) configurations. Currently these configurations can only be stored in a text file. If there's sufficient interest, other data storage methods may be supported in the future (manifesting it π).
π DESCRIPTION π
The use of per-user configuration is defined in the application configuration file with the setting "Per_User". The value of that setting gives you the type and the location of the per-user configuration information. The currently supported type is text. "User" here means an email address of a recipient of the message.
Most options available at the application level (see man 5 policyd-spf.conf) can be adjusted on a per-user basis. But here's the catch, bestie β per-user checks can only be done as part of smtpd_recipient_restrictions. Per-user actions are not possible at other stages of the SMTP dialogue. The user isn't even known yet for smtpd_client_restrictions, smtpd_helo_restrictions, or smtpd_sender_restrictions. And if you use it during smtpd_data_restrictions or smtpd_end_of_data_restrictions, the entire message will be available only if the message was only to a single recipient. If per-user configurations are used when recipient information is not available, warnings will be logged and the per-user information will be ignored. π
π¨ These options cannot be modified on a per user basis:Lookup_Time,Header_Type,Hide_Receiver,Authserv_Id,Prospective,debugLevel, andMock. Do not come for them, they are not available.
In addition to specifying individual users, regular expression matching is also available β but it may have performance implications, since the entire user table has to be traversed for each message recipient. She works hard but she's expensive π
π OPTIONS π
π Text Per-User Configuration File π
The text file option is useful for testing and when only a small number of users require per-user configurations. It is specified in the main configuration file:
"Per_User = text,/etc/pypolicyd-spf/userconf"
Lines beginning with # are treated as comments and ignored. The location of the file is determined by the system administrator. No default file is provided in or installed by the package β you gotta make your own, icon π
The configuration of the file is a comma separated combination of user and configuration information, with one line per user's configuration information (NOTE: due to man page formatting requirements, these lines may be wrapped in your pager β in the config file, it must be one line per user):
postmaster@example.com,Mail_From_reject=No_Check|PermError_reject=False|HELO_reject=SPF_Not_Pass|TestOnly=1|debugLevel=5|skip_addresses=127.0.0.0/8,::ffff:127.0.0.0//104,::1//128|TempError_Defer=False
strict@example.com,PermError_reject=True|HELO_reject=SPF_Not_Pass|TempError_Defer=True
It is not necessary to specify all configuration parameters for each user β only those that are different than the overall configuration need to be specified. Low effort, high reward, we love to see it πΈ
If the specified per user configuration file is missing, an error is logged and the global configuration is used instead. So no crash-out, she just falls back π«Ά
π SEE ALSO π
man 1 policyd-spf, man 5 policyd-spf.conf, python-spf, <http://www.openspf.org>, RFC 7208
π AUTHORS π
This version of policyd-spf was written by Copyright Β© 2007-2016, Scott Kitterman <scott@kitterman.com>. It is derived from Tumgreyspf, written by Sean Reifschneider, tummy.com, ltd <jafo@tummy.com>.
This man-page was created by Scott Kitterman <scott@kitterman.com> and is licensed under the same terms as the program.
okay bestie that's the whole page, you ate that π this was policy-spf.peruser(5) from File Formats Manual, version 3.1.0 β go configure something iconic, mwah π
β¨π¦
π¦ where this page comes from
- debian trixie: postfix-policyd-spf-python 3.1.0-2
- epel 10: pypolicyd-spf 3.1.0-6.el10_2 Β· Apache-2.0
- fedora 43: pypolicyd-spf 3.1.0-7.fc43 Β· Apache-2.0
- fedora 44: pypolicyd-spf 3.1.0-8.fc44 Β· Apache-2.0
- nixos 26.05: spf-engine 3.1.0
- nixpkgs unstable: spf-engine 3.1.0
- ubuntu questing: postfix-policyd-spf-python 3.1.0-2
- ubuntu resolute: postfix-policyd-spf-python 3.1.0-2build1
- ubuntu stonking: postfix-policyd-spf-python 3.1.0-4 Β· GPL-2.0-only OR Apache-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms