[pmg-devel] [PATCH pmg-api 3/3] pmgspamreport: purge before sending reports

Stoiko Ivanov s.ivanov at proxmox.com
Thu Mar 19 14:02:27 CET 2020


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 at proxmox.com>
---
Alternatively if the order should remain send, then purge prefixing
'/usr/bin/pmgqm' with '-' in the ExecStart line achieves the same effect

 debian/pmgspamreport.service | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/pmgspamreport.service b/debian/pmgspamreport.service
index 5b7c094..a20214f 100644
--- a/debian/pmgspamreport.service
+++ b/debian/pmgspamreport.service
@@ -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
 
-- 
2.20.1




More information about the pmg-devel mailing list