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 --- mod/notification-email | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mod') diff --git a/mod/notification-email b/mod/notification-email index ea7d26a..8f624e9 100644 --- a/mod/notification-email +++ b/mod/notification-email @@ -4,6 +4,7 @@ # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md :global FlushEmailQueue; +:global LogForwardFilterLogForwarding; :global NotificationFunctions; :global SendEMail; :global SendEMail2; @@ -88,6 +89,21 @@ } } +# generate filter for log-forward +:set LogForwardFilterLogForwarding do={ + :global Identity; + + :global EscapeForRegEx; + :global QuotedPrintable; + :global SymbolForNotification; + + :return ("^Error sending e-mail <(" . \ + [ $EscapeForRegEx [ $QuotedPrintable ("[" . $Identity . "] " . \ + [ $SymbolForNotification "memo" ] . "Log Forwarding") ] ] . "|" . \ + [ $EscapeForRegEx [ $QuotedPrintable ("[" . $Identity . "] " . \ + [ $SymbolForNotification "warning-sign" ] . "Log Forwarding") ] ] . ")>:"); +} + # send notification via e-mail - expects one array argument :set ($NotificationFunctions->"email") do={ :local Notification $1; -- cgit v1.2.3-70-g09d2