Skip to content

Commit 289ea21

Browse files
committed
Add separate pattern for local delivery parsing
1 parent ee9d60a commit 289ea21

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

postfix.grok

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ POSTFIX_SCACHE_TIMESTAMP statistics: start interval %{SYSLOGTIMESTAMP:postfix_sc
120120
# verify patterns
121121
POSTFIX_VERIFY_CACHE cache %{DATA} %{POSTFIX_VERIFY_CLEANUP_TYPE:postfix_verify_cleanup_type} cleanup: retained=%{INT:postfix_verify_cache_retained} dropped=%{INT:postfix_verify_cache_dropped} entries
122122

123+
# local patterns
124+
POSTFIX_LOCAL_DELIVERY %{POSTFIX_KEYVALUE} status=%{STATUS_WORD:postfix_status}( \(%{GREEDYDATA:postfix_local_response}\))?
125+
123126
# aggregate all patterns
124127
POSTFIX_SMTPD %{POSTFIX_SMTPD_CONNECT}|%{POSTFIX_SMTPD_DISCONNECT}|%{POSTFIX_SMTPD_LOSTCONN}|%{POSTFIX_SMTPD_NOQUEUE}|%{POSTFIX_SMTPD_PIPELINING}|%{POSTFIX_TLSCONN}|%{POSTFIX_WARNING}|%{POSTFIX_SMTPD_PROXY}|%{POSTFIX_KEYVALUE}
125128
POSTFIX_CLEANUP %{POSTFIX_CLEANUP_MESSAGEID}|%{POSTFIX_CLEANUP_MILTER}|%{POSTFIX_CLEANUP_PREPEND}|%{POSTFIX_WARNING}|%{POSTFIX_KEYVALUE}
@@ -140,7 +143,7 @@ POSTFIX_POSTDROP %{POSTFIX_WARNING}
140143
POSTFIX_SCACHE %{POSTFIX_SCACHE_LOOKUPS}|%{POSTFIX_SCACHE_SIMULTANEOUS}|%{POSTFIX_SCACHE_TIMESTAMP}
141144
POSTFIX_TRIVIAL_REWRITE %{POSTFIX_WARNING}
142145
POSTFIX_TLSMGR %{POSTFIX_WARNING}
143-
POSTFIX_LOCAL %{POSTFIX_SMTP_DELIVERY}|%{POSTFIX_WARNING}
146+
POSTFIX_LOCAL %{POSTFIX_LOCAL_DELIVERY}|%{POSTFIX_WARNING}
144147
POSTFIX_VIRTUAL %{POSTFIX_SMTP_DELIVERY}
145148
POSTFIX_ERROR %{POSTFIX_ERROR_ANY}
146149
POSTFIX_POSTSUPER %{POSTFIX_POSTSUPER_ACTION}|%{POSTFIX_POSTSUPER_SUMMARY}

test/local_0001.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ results:
44
postfix_queueid: 2A22C263F6
55
postfix_keyvalue_data: "to=user@hostname.example.com, orig_to=root@localhost, relay=local, delay=0.07, delays=0.04/0/0/0.03, dsn=2.0.0,"
66
postfix_status: sent
7-
postfix_smtp_response: "delivered to command: procmail -a \"$EXTENSION\""
7+
postfix_local_response: "delivered to command: procmail -a \"$EXTENSION\""

test/local_0002.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ results:
44
postfix_queueid: 892A0205B6
55
postfix_keyvalue_data: "to=ghdsgfhdslfh@localhost, relay=local, delay=0.05, delays=0.02/0/0/0.02, dsn=5.1.1,"
66
postfix_status: bounced
7-
postfix_smtp_response: "unknown user: \"ghdsgfhdslfh\""
7+
postfix_local_response: "unknown user: \"ghdsgfhdslfh\""

0 commit comments

Comments
 (0)