From 868557a24ae544f778531df71c4842fac72f308d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 11 Jan 2023 09:21:13 +0100 Subject: log-forward: generate filter in mod/notification-email --- log-forward | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'log-forward') diff --git a/log-forward b/log-forward index df69008..642035c 100644 --- a/log-forward +++ b/log-forward @@ -19,11 +19,11 @@ :global LogForwardRateLimit; :global NotificationsWithSymbols; -:global EscapeForRegEx; +:global EitherOr; :global HexToNum; :global IfThenElse; +:global LogForwardFilterLogForwarding; :global LogPrintExit2; -:global QuotedPrintable; :global ScriptLock; :global SendNotification2; :global SymbolByUnicodeName; @@ -48,12 +48,8 @@ $ScriptLock $0; :local MessageVal; :local MessageDups ({}); -:local LogForwardFilterLogForwarding ("^Error sending e-mail <(" . \ - [ $EscapeForRegEx [ $QuotedPrintable ("[" . $Identity . "] " . \ - [ $SymbolForNotification "memo" ] . "Log Forwarding") ] ] . "|" . \ - [ $EscapeForRegEx [ $QuotedPrintable ("[" . $Identity . "] " . \ - [ $SymbolForNotification "warning-sign" ] . "Log Forwarding") ] ] . ")>:"); -:foreach Message in=[ /log/find where (!(message="") and !(message~$LogForwardFilterLogForwarding) and \ +:foreach Message in=[ /log/find where (!(message="") and \ + !(message~[ $EitherOr [ $LogForwardFilterLogForwarding ] ("\$^") ]) and \ !(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \ topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={ :set MessageVal [ /log/get $Message ]; -- cgit v1.2.3-54-g00ecf