]> git.proxmox.com Git - pmg-api.git/commitdiff
config: postfix: make smtp-filter-timeout configurable
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 12 Jan 2024 19:21:50 +0000 (20:21 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Feb 2024 15:03:18 +0000 (16:03 +0100)
accessing the value in the config-template needs to use the
item virtual method (`pmg.mail.item('filter-timeout')` instead of the
. operator, due to using kebab-case for 'filter-timeout' see [0].

the minimal value is set to 2 as we add 1 second for the rules
processing in the next patch, and postfix has 1 as minimum.

[0] http://template-toolkit.org/docs/manual/VMethods.html#section_item

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by:  Dominik Csapak <d.csapak@proxmox.com>
src/PMG/Config.pm
src/templates/main.cf.in

index fefded13fac63a8082c296417d156061657ce963..71d4c0b8e04b38586481d8cc9661254fe4c9f41c 100644 (file)
@@ -711,6 +711,14 @@ sub properties {
            type => 'boolean',
            default => 1
        },
+       'filter-timeout' => {
+           description => "Timeout for the processing of one mail (in seconds)  (postfix option"
+               ." `smtpd_proxy_timeout` and `lmtp_data_done_timeout`)",
+           type => 'integer',
+           default => 600,
+           minimum => 2,
+           maximum => 86400
+       },
     };
 }
 
@@ -752,6 +760,7 @@ sub options {
        before_queue_filtering => { optional => 1 },
        ndr_on_block => { optional => 1 },
        smtputf8 => { optional => 1 },
+       'filter-timeout' => { optional => 1 },
     };
 }
 
index 51cdd8b161fd75765a1886038bec5b90104bbdeb..434d5cd624db9c6be03ed0842104b5e3044671b2 100644 (file)
@@ -50,9 +50,10 @@ default_transport = smtp:[% pmg.mail.smarthost %]:[% pmg.mail.smarthostport %]
 [% END %]
 
 [% IF pmg.mail.before_queue_filtering -%]
-smtpd_proxy_timeout = 600s
+smtpd_proxy_timeout = [% pmg.mail.item('filter-timeout') %]s
 [% ELSE %]
 content_filter=scan:127.0.0.1:10024
+lmtp_data_done_timeout = [% pmg.mail.item('filter-timeout') %]s
 [%- END %]
 
 mail_name = Proxmox