policyd-rate-limit.yaml(5)
π policyd-rate-limit.yaml β the config file glow-up π
okay bestie, this is the manual page for policyd-rate-limit.yaml(5), aka the config file for policyd-rate-limit. It lives in section 5 of the manual (file formats, for the uninitiated β¨) and it's part of the policyd-rate-limit world. Let's get into it π«Ά
β¨ NAME β¨
policyd-rate-limit.yaml β the configuration parameters for policyd-rate-limit π
πΈ DESCRIPTION πΈ
so here's the tea β β policyd-rate-limit(8) used to roll with a python(1)-style config file, and back then it did not use a yaml(3pm) file. Now it does: the yaml file gets read on startup. Literally glow-up era.
Quick glossary for you boo:
.conffiles are the old python-format configuration files π.yamlfiles are the new ones β¨
Old-style configuration files are deprecated, and you should NOT be using them. periodt. π
If the --file option is not set, it goes hunting for configuration files on these paths, in this order:
~/.config/policyd-rate-limit.conf
~/.config/policyd-rate-limit.yaml
/etc/policyd-rate-limit.conf
/etc/policyd-rate-limit.yaml
and if it doesn't find any of them, it just exits π that's it, that's the whole vibe.
π SETTINGS π
Every single one, no skips, we don't gatekeep here π
debugβ makespolicyd-rate-limitdump its logs to stderr. The default isTrue.userβ the userpolicyd-rate-limitwill use to drop privileges. The default is"policyd-rate-limit".groupβ the grouppolicyd-rate-limitwill use to drop privileges. The default is"policyd-rate-limit".pidfileβ the path where the program will try to write its pid. The default is"/var/run/policyd-rate-limit/policyd-rate-limit.pid". If the parent directory doesn't exist,policyd-rate-limitwill try to create it andchownit. main character energy tbh πmysql_configβ the config for connecting to a mysql server. It should be a dictionary of parameters passed to theMySQLdb.connectfunction. Peep thepython3-mysqldbdocumentation for the deets.pgsql_configβ the config for connecting to a postgresql server. It should be a dictionary of parameters passed to thepsycopg2.connectfunction. Check thepython3-psycopg2documentation.sqlite_configβ the config for connecting to a sqlite3 database. It should be a dictionary of parameters passed to thesqlite3.connectfunction. See thepython3documentation.backendβ which data backend to use. Possible values are0for sqlite3,1for mysql and2for postgresql. The default is0, so sqlite3 backend. slay.SOCKETβ the socket to bind to. Can be a path to a unix socket, or a couple[ip, port]. The default is"/var/spool/postfix/ratelimit/policy". If the parent directory doesn't exist,policyd-rate-limitwill try to create it andchownit πsocket_permissionβ the permissions on the unix socket (if a unix socket is used). The default is0o666.limitsβ a list of couples[number of emails, number of seconds]. If one of the elements of the list is exceeded (more than number of emails within number of seconds for an ip address or a sasl username), postfix will return a temporary failure. not the vibe you want π«limits_by_idβ a dictionary of id -> limit list (seelimits). Used to override limits and set custom limits for a particular id. Use an empty list for no limits for a particular id. Ids are sasl usernames or ip addresses. The default is{}.limit_by_saslβ apply limits by sasl usernames. The default isTrue.limit_by_senderβ apply limits by sender addresses if the sasl username is not found. The default isFalse.limit_by_ipβ apply limits by ip addresses if the sasl username is not found. The default isFalse.limited_networksβ a list of ip networks in cidr notation on which limits are applied. An empty list is equal tolimit_by_ip = False. Put"0.0.0.0/0"and::/0for every ip address.success_actionβ if no limits are reached, which action postfix should do. The default is"dunno". Seeaccess(5)for possible actions.fail_actionβ if a limit is reached, which action postfix should do. The default is"defer_if_permit Rate limit reach, retry later". Seeaccess(5)for possible actions.db_error_actionβ if we can't connect to the database backend, which action postfix should do. The default is"dunno". Seeaccess(5)for possible actions.config_fileβ this parameter is automatically set to the path of the configuration file currently in use. You can call it together with--get-configto find out which configuration file is being used. lowkey so useful πreportβ ifTrue, send a report toreport_toabout users reaching limits each time--cleanis called. The default isFalse.report_fromβ from who to send email reports. It must be defined whenreportisTrue.report_toβ the address(es) to send email reports to. It must be defined whenreportisTrue. It can be a single email address or a list of email addresses.report_subjectβ the subject of the report email. The default is"policyd-rate-limit report".report_limitsβ a list of number of seconds from thelimitslist for which you want to be reported. The default is[86400].report_only_if_neededβ only send a report if some users have reached a reported limit. The default isTrue.smtp_serverβ the smtp server to use to send emails, as["host", port]. The default is["localhost", 25].smtp_starttlsβ should we use starttls to send mails? (you should set this toTrueif you usesmtp_credentials). The default isFalse.smtp_credentialsβ should we use credentials to connect tosmtp_server? if yes, set["user", "password"], elsenull. The default isnull.count_modeβ how sent mail is counted.- Set to
0: eachRCPT TOis counted individually. This is the way it was done historically. If set to0, the postfixcheck_policy_servicemust be set insmtpd_recipient_restrictions.
- Set to
This is deprecated and should not be used anymore. π
- Set to
1: recipients are counted in theDATAstage. The postfix parametercheck_policy_servicemust be defined insmtpd_data_restrictions. This is the new default. β¨
π¦ SEE ALSO π¦
π AUTHOR π
Valentin Samir <valentin.samir@crans.org>
title_upper: policyd-rate-limit.yaml
π COPYRIGHT π
GPL-3
and that's the whole page, bestie π«Ά this was policyd-rate-limit.yaml(5), version 3.8, dated 2016-08-04, brought to you by policyd-rate-limit. ily, go configure something iconic π
β¨π
π¦ where this page comes from
- ubuntu resolute: policyd-rate-limit 1.2.0-2 Β· GPL-3.0-only
- ubuntu stonking: policyd-rate-limit 1.2.0-6 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms