]> git.proxmox.com Git - pmg-api.git/commit
pmg-smtp-filter: die if processing took longer than the timeout
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 12 Jan 2024 19:21:51 +0000 (20:21 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Feb 2024 15:03:18 +0000 (16:03 +0100)
commit905a50b035ae7908bf61f10009d91450de11b6f7
tree14d59f6282c5626b3977da38a77650c268941ffa
parent479028dfe1517b1272df1a14d7b4b655a7aec341
pmg-smtp-filter: die if processing took longer than the timeout

In case a mail took longer to get processed than the configured
timeout - 1 second - `die` before running any action.

The `die` results in a temporary failure to be reported to the sending
server by PMG::SMTP.pm ("451 4.4.0 detected undelivered mail").

The reason for the 1s extra slack is to have some time to actually
run the action - and also justified that in both cases (postfix
detecting the timeout, and pmg-smtp-filter `die`ing the sender gets
a temporary failure reported back).

Tested with a small filter_timeout setting (30), and a larger sleep in
added in analyze_virus.

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/bin/pmg-smtp-filter