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:

  • .conf files are the old python-format configuration files 🐍
  • .yaml files 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 β€” makes policyd-rate-limit dump its logs to stderr. The default is True.
  • user β€” the user policyd-rate-limit will use to drop privileges. The default is "policyd-rate-limit".
  • group β€” the group policyd-rate-limit will 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-limit will try to create it and chown it. main character energy tbh πŸ‘‘
  • mysql_config β€” the config for connecting to a mysql server. It should be a dictionary of parameters passed to the MySQLdb.connect function. Peep the python3-mysqldb documentation for the deets.
  • pgsql_config β€” the config for connecting to a postgresql server. It should be a dictionary of parameters passed to the psycopg2.connect function. Check the python3-psycopg2 documentation.
  • sqlite_config β€” the config for connecting to a sqlite3 database. It should be a dictionary of parameters passed to the sqlite3.connect function. See the python3 documentation.
  • backend β€” which data backend to use. Possible values are 0 for sqlite3, 1 for mysql and 2 for postgresql. The default is 0, 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-limit will try to create it and chown it πŸ’…
  • socket_permission β€” the permissions on the unix socket (if a unix socket is used). The default is 0o666.
  • 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 (see limits). 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 is True.
  • limit_by_sender β€” apply limits by sender addresses if the sasl username is not found. The default is False.
  • limit_by_ip β€” apply limits by ip addresses if the sasl username is not found. The default is False.
  • limited_networks β€” a list of ip networks in cidr notation on which limits are applied. An empty list is equal to limit_by_ip = False. Put "0.0.0.0/0" and ::/0 for every ip address.
  • success_action β€” if no limits are reached, which action postfix should do. The default is "dunno". See access(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". See access(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". See access(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-config to find out which configuration file is being used. lowkey so useful πŸ”
  • report β€” if True, send a report to report_to about users reaching limits each time --clean is called. The default is False.
  • report_from β€” from who to send email reports. It must be defined when report is True.
  • report_to β€” the address(es) to send email reports to. It must be defined when report is True. 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 the limits list 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 is True.
  • 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 to True if you use smtp_credentials). The default is False.
  • smtp_credentials β€” should we use credentials to connect to smtp_server? if yes, set ["user", "password"], else null. The default is null.
  • count_mode β€” how sent mail is counted.
    • Set to 0: each RCPT TO is counted individually. This is the way it was done historically. If set to 0, the postfix check_policy_service must be set in smtpd_recipient_restrictions.
This is deprecated and should not be used anymore. πŸ’€
  • Set to 1: recipients are counted in the DATA stage. The postfix parameter check_policy_service must be defined in smtpd_data_restrictions. This is the new default. ✨

πŸ¦‹ SEE ALSO πŸ¦‹

policyd-rate-limit(8)


πŸ‘‘ AUTHOR πŸ‘‘

Valentin Samir <valentin.samir@crans.org>

title_upper: policyd-rate-limit.yaml


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