aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-08-06 16:25:06 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-08-06 16:35:51 +0200
commit9a5d55da0dca37a8e921c411264b4187ba50e3e9 (patch)
treec2f9577241677b63ff18673ec0da4a64cae4dfa2
parent5b789d298b8d6d48d91601b335e1feeeb1374f14 (diff)
mod/notification-email: introduce $PurgeEmailQueue
... to purge the queue and remove the scheduler.
-rw-r--r--doc/mod/notification-email.md5
-rw-r--r--mod/notification-email.rsc9
2 files changed, 14 insertions, 0 deletions
diff --git a/doc/mod/notification-email.md b/doc/mod/notification-email.md
index e4ceda2..8dc2ecf 100644
--- a/doc/mod/notification-email.md
+++ b/doc/mod/notification-email.md
@@ -64,6 +64,11 @@ Place this before you call them:
:global SendEMail;
:global SendNotification;
+In case there is a situation when the queue needs to be purged there is a
+function available:
+
+ $PurgeEMailQueue;
+
See also
--------
diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc
index 7be3abe..e266201 100644
--- a/mod/notification-email.rsc
+++ b/mod/notification-email.rsc
@@ -10,6 +10,7 @@
:global LogForwardFilterLogForwarding;
:global NotificationEMailSubject;
:global NotificationFunctions;
+:global PurgeEMailQueue;
:global QuotedPrintable;
:global SendEMail;
:global SendEMail2;
@@ -156,6 +157,14 @@
}
}
+# purge the e-mail queue
+:set PurgeEMailQueue do={
+ :global EmailQueue;
+
+ /system/scheduler/remove [ find where name="\$FlushEmailQueue" ];
+ :set EmailQueue;
+}
+
# convert string to quoted-printable
:global QuotedPrintable do={
:local Input [ :tostr $1 ];