]> git.proxmox.com Git - pmg-api.git/commitdiff
pmgspamreport: purge before sending reports
authorStoiko Ivanov <s.ivanov@proxmox.com>
Thu, 19 Mar 2020 13:02:27 +0000 (14:02 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 20 Mar 2020 16:47:07 +0000 (17:47 +0100)
By cleaning the quarantine (database and files in spool directory), before
trying to send out mail we can prevent the file-system and database from
filling up because of an unrelated problem in sending out mails.

Originally discovered while analyzing why the quarantine spooldir on a
non-master node fills up, while being limted in size on the master-node:
the call to send out the reports errored out, because the node was not master.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
debian/pmgspamreport.service

index 5b7c094846151a18ba7666288fce4d15d9bfa3fa..a20214f64f16397c1926e3e2fe6a3e795a3c69a5 100644 (file)
@@ -4,6 +4,6 @@ ConditionPathExists=/usr/bin/pmgqm
 
 [Service]
 Type=oneshot
+ExecStartPre=-/usr/bin/pmgqm purge
 ExecStart=/usr/bin/pmgqm send --timespan yesterday
-ExecStartPost=/usr/bin/pmgqm purge