From 3b3d93a3f7d400b92c8956a751e310a888543c9a Mon Sep 17 00:00:00 2001 From: Tom Hendrikx Date: Mon, 15 Jan 2024 16:01:45 +0100 Subject: [PATCH] Some warning messages have the queue-id after the warning level --- postfix.grok | 4 ++-- test/cleanup_0012.yaml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 test/cleanup_0012.yaml diff --git a/postfix.grok b/postfix.grok index 3157096..9700c1b 100644 --- a/postfix.grok +++ b/postfix.grok @@ -32,8 +32,8 @@ GREEDYDATA_NO_BRACKET [^<>]* STATUS_WORD [\w-]* # warning patterns -POSTFIX_WARNING_WITH_KV (%{POSTFIX_QUEUEID:postfix_queueid}: )?%{POSTFIX_WARNING_LEVEL:postfix_message_level}: (%{POSTFIX_CLIENT_INFO}: )?%{GREEDYDATA:postfix_message}; %{POSTFIX_KEYVALUE_DATA:postfix_keyvalue_data} -POSTFIX_WARNING_WITHOUT_KV (%{POSTFIX_QUEUEID:postfix_queueid}: )?%{POSTFIX_WARNING_LEVEL:postfix_message_level}: (%{POSTFIX_CLIENT_INFO}: )?%{GREEDYDATA:postfix_message} +POSTFIX_WARNING_WITH_KV (%{POSTFIX_QUEUEID:postfix_queueid}: )?%{POSTFIX_WARNING_LEVEL:postfix_message_level}: (%{POSTFIX_QUEUEID:postfix_queueid}: )?(%{POSTFIX_CLIENT_INFO}: )?%{GREEDYDATA:postfix_message}; %{POSTFIX_KEYVALUE_DATA:postfix_keyvalue_data} +POSTFIX_WARNING_WITHOUT_KV (%{POSTFIX_QUEUEID:postfix_queueid}: )?%{POSTFIX_WARNING_LEVEL:postfix_message_level}: (%{POSTFIX_QUEUEID:postfix_queueid}: )?(%{POSTFIX_CLIENT_INFO}: )?%{GREEDYDATA:postfix_message} POSTFIX_WARNING %{POSTFIX_WARNING_WITH_KV}|%{POSTFIX_WARNING_WITHOUT_KV} # smtpd patterns diff --git a/test/cleanup_0012.yaml b/test/cleanup_0012.yaml new file mode 100644 index 0000000..c6b9037 --- /dev/null +++ b/test/cleanup_0012.yaml @@ -0,0 +1,6 @@ +pattern: ^%{POSTFIX_CLEANUP}$ +data: "warning: 9BECF3F19D: sender_canonical_maps map lookup problem for sender@example.com -- message not accepted, try again later" +results: + postfix_queueid: 9BECF3F19D + postfix_message_level: warning + postfix_message: "sender_canonical_maps map lookup problem for sender@example.com -- message not accepted, try again later"