Skip to content

Commit 2cdf1fa

Browse files
committed
Added support for postmaster bounces
Also extract the bounce recipient and the boucne reason from the log message
1 parent de15798 commit 2cdf1fa

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

postfix.grok

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ POSTFIX_MASTER_START (daemon started|reload) -- version %{DATA:postfix_version},
112112
POSTFIX_MASTER_EXIT terminating on signal %{INT:postfix_termination_signal}
113113

114114
# bounce patterns
115-
POSTFIX_BOUNCE_NOTIFICATION %{POSTFIX_QUEUEID:postfix_queueid}: sender (non-delivery|delivery status|delay) notification: %{POSTFIX_QUEUEID:postfix_bounce_queueid}
115+
POSTFIX_BOUNCE_NOTIFICATION %{POSTFIX_QUEUEID:postfix_queueid}: (?<postfix_bounce_recipient>(sender|postmaster)) (?<postfix_bounce_reason>(non-delivery|delivery status|delay)) notification: %{POSTFIX_QUEUEID:postfix_bounce_queueid}
116116

117117
# scache patterns
118118
POSTFIX_SCACHE_LOOKUPS statistics: (address|domain) lookup hits=%{INT:postfix_scache_hits} miss=%{INT:postfix_scache_miss} success=%{INT:postfix_scache_success}%

test/bounce_0001.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ data: "17CCA8044: sender non-delivery notification: ADD2F8052"
33
results:
44
postfix_queueid: 17CCA8044
55
postfix_bounce_queueid: ADD2F8052
6+
postfix_bounce_recipient: sender
7+
postfix_bounce_reason: non-delivery

test/bounce_0002.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ data: "65AFB8B5: sender delivery status notification: 1DF35917"
33
results:
44
postfix_queueid: 65AFB8B5
55
postfix_bounce_queueid: 1DF35917
6+
postfix_bounce_recipient: sender
7+
postfix_bounce_reason: delivery status

test/bounce_0003.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ data: "264FE1A18: sender delay notification: 0A87A1A08"
33
results:
44
postfix_queueid: 264FE1A18
55
postfix_bounce_queueid: 0A87A1A08
6+
postfix_bounce_recipient: sender
7+
postfix_bounce_reason: delay

test/bounce_0004.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pattern: ^%{POSTFIX_BOUNCE}$
2+
data: "482E4404AC8: postmaster non-delivery notification: 47335405A44"
3+
results:
4+
postfix_queueid: 482E4404AC8
5+
postfix_bounce_queueid: 47335405A44
6+
postfix_bounce_recipient: postmaster
7+
postfix_bounce_reason: non-delivery

0 commit comments

Comments
 (0)