From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-api v2 3/4] config: postfix: make smtp-filter-timeout configurable
Date: Fri, 12 Jan 2024 20:21:50 +0100 [thread overview]
Message-ID: <20240112192151.40998-5-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20240112192151.40998-1-s.ivanov@proxmox.com>
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>
---
src/PMG/Config.pm | 9 +++++++++
src/templates/main.cf.in | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/PMG/Config.pm b/src/PMG/Config.pm
index 7339e0d..43baec5 100644
--- a/src/PMG/Config.pm
+++ b/src/PMG/Config.pm
@@ -699,6 +699,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
+ },
};
}
@@ -740,6 +748,7 @@ sub options {
before_queue_filtering => { optional => 1 },
ndr_on_block => { optional => 1 },
smtputf8 => { optional => 1 },
+ 'filter-timeout' => { optional => 1 },
};
}
diff --git a/src/templates/main.cf.in b/src/templates/main.cf.in
index 51cdd8b..434d5cd 100644
--- a/src/templates/main.cf.in
+++ b/src/templates/main.cf.in
@@ -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
--
2.39.2
next prev parent reply other threads:[~2024-01-12 19:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 19:21 [pmg-devel] [PATCH pmg-api/pmg-docs v2] make filter timeout configurable Stoiko Ivanov
2024-01-12 19:21 ` [pmg-devel] [PATCH pmg-docs v2 1/1] doc-generator: add new option filter-timeout Stoiko Ivanov
2024-01-12 19:21 ` [pmg-devel] [PATCH pmg-api v2 1/4] templates: postfix: set same timeouts for before and after-queue Stoiko Ivanov
2024-01-12 19:21 ` [pmg-devel] [PATCH pmg-api v2 2/4] pmg-smtp-filter: cleanup use of gettimeofday Stoiko Ivanov
2024-01-12 19:21 ` Stoiko Ivanov [this message]
2024-01-12 19:21 ` [pmg-devel] [PATCH pmg-api v2 4/4] pmg-smtp-filter: die if processing took longer than the timeout Stoiko Ivanov
2024-02-21 14:35 ` [pmg-devel] [PATCH pmg-api/pmg-docs v2] make filter timeout configurable Dominik Csapak
2024-02-22 15:23 ` [pmg-devel] applied-series: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240112192151.40998-5-s.ivanov@proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.