From e9780d9b4e07af9b09446fc74ae43f31aba1a233 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 8 Jun 2022 19:36:14 +0200 Subject: log-forward: fix the pattern excluding mail errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This looked smart, but did not work... 🤪 Unicode characters have to be in place to make $QuotedPrintable have an effect. So fix it... We have duplicate pattern if symbols are disabled, but that does not hurt. --- log-forward | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'log-forward') diff --git a/log-forward b/log-forward index 6ccf39c..63c7ea7 100644 --- a/log-forward +++ b/log-forward @@ -19,7 +19,6 @@ :global LogForwardRateLimit; :global NotificationsWithSymbols; -:global CharacterReplace; :global EscapeForRegEx; :global HexToNum; :global IfThenElse; @@ -49,9 +48,11 @@ $ScriptLock $0; :local MessageVal; :local MessageDups [ :toarray "" ]; -:local LogForwardFilterLogForwarding ("^" . [ $CharacterReplace [ $EscapeForRegEx ("Error sending e-mail <" . \ - [ $QuotedPrintable ("[" . $Identity . "] %SYMBOLREGEX%Log Forwarding") ] . ">:") ] "%SYMBOLREGEX%" \ - ("((" . [ $SymbolByUnicodeName "memo" ] . "|" . [ $SymbolByUnicodeName "warning-sign" ] . ") )?") ]); +: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 \ !(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \ topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={ -- cgit v1.2.3-70-g09d2