diff --git a/defaults/main.yml b/defaults/main.yml index 4da926e..7feec4d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -276,6 +276,13 @@ postfix_virtual_alias_maps: postfix_local_dest_concurrency_limit: 2 postfix_default_destination_concurrency_limit: 5 +postfix_smtp_destination_concurrency_limit: "{{ postfix_default_destination_concurrency_limit }}" +# Other rate limiting parameters +postfix_enforce_users_rate_limiting: false +postfix_smtpd_client_message_rate_limit: 4 +postfix_anvil_rate_time_unit: "60s" +postfix_default_destination_rate_delay: "2s" +postfix_default_destination_recipient_limit: 50 postfix_behind_haproxy: False postfix_postscreen_port: 1024 diff --git a/templates/main.cf.j2 b/templates/main.cf.j2 index 6ad36b4..bc98b66 100644 --- a/templates/main.cf.j2 +++ b/templates/main.cf.j2 @@ -745,6 +745,15 @@ smtpd_banner = $myhostname ESMTP $mail_name local_destination_concurrency_limit = {{ postfix_local_dest_concurrency_limit }} default_destination_concurrency_limit = {{ postfix_default_destination_concurrency_limit }} +smtp_destination_concurrency_limit = {{ postfix_smtp_destination_concurrency_limit }} + +{% if postfix_enforce_users_rate_limiting %} +# Other rate limiting parameters +smtpd_client_message_rate_limit = {{ postfix_smtpd_client_message_rate_limit }} +anvil_rate_time_unit = {{ postfix_anvil_rate_time_unit }} +default_destination_rate_delay = {{ postfix_default_destination_rate_delay }} +default_destination_recipient_limit = {{ postfix_default_destination_recipient_limit }} +{% endif %} # DEBUGGING CONTROL #