diff --git a/postfix.grok b/postfix.grok index 11db0b4..b003dbb 100644 --- a/postfix.grok +++ b/postfix.grok @@ -112,7 +112,7 @@ POSTFIX_MASTER_START (daemon started|reload) -- version %{DATA:postfix_version}, POSTFIX_MASTER_EXIT terminating on signal %{INT:postfix_termination_signal} # bounce patterns -POSTFIX_BOUNCE_NOTIFICATION %{POSTFIX_QUEUEID:postfix_queueid}: sender (non-delivery|delivery status|delay) notification: %{POSTFIX_QUEUEID:postfix_bounce_queueid} +POSTFIX_BOUNCE_NOTIFICATION %{POSTFIX_QUEUEID:postfix_queueid}: (?(sender|postmaster)) (?(non-delivery|delivery status|delay)) notification: %{POSTFIX_QUEUEID:postfix_bounce_queueid} # scache patterns POSTFIX_SCACHE_LOOKUPS statistics: (address|domain) lookup hits=%{INT:postfix_scache_hits} miss=%{INT:postfix_scache_miss} success=%{INT:postfix_scache_success}% diff --git a/test/bounce_0001.yaml b/test/bounce_0001.yaml index 4480694..648cc04 100644 --- a/test/bounce_0001.yaml +++ b/test/bounce_0001.yaml @@ -3,3 +3,5 @@ data: "17CCA8044: sender non-delivery notification: ADD2F8052" results: postfix_queueid: 17CCA8044 postfix_bounce_queueid: ADD2F8052 + postfix_bounce_recipient: sender + postfix_bounce_reason: non-delivery diff --git a/test/bounce_0002.yaml b/test/bounce_0002.yaml index 025bde9..7120e93 100644 --- a/test/bounce_0002.yaml +++ b/test/bounce_0002.yaml @@ -3,3 +3,5 @@ data: "65AFB8B5: sender delivery status notification: 1DF35917" results: postfix_queueid: 65AFB8B5 postfix_bounce_queueid: 1DF35917 + postfix_bounce_recipient: sender + postfix_bounce_reason: delivery status diff --git a/test/bounce_0003.yaml b/test/bounce_0003.yaml index b54f640..7c3e648 100644 --- a/test/bounce_0003.yaml +++ b/test/bounce_0003.yaml @@ -3,3 +3,5 @@ data: "264FE1A18: sender delay notification: 0A87A1A08" results: postfix_queueid: 264FE1A18 postfix_bounce_queueid: 0A87A1A08 + postfix_bounce_recipient: sender + postfix_bounce_reason: delay diff --git a/test/bounce_0004.yaml b/test/bounce_0004.yaml new file mode 100644 index 0000000..62b61ee --- /dev/null +++ b/test/bounce_0004.yaml @@ -0,0 +1,7 @@ +pattern: ^%{POSTFIX_BOUNCE}$ +data: "482E4404AC8: postmaster non-delivery notification: 47335405A44" +results: + postfix_queueid: 482E4404AC8 + postfix_bounce_queueid: 47335405A44 + postfix_bounce_recipient: postmaster + postfix_bounce_reason: non-delivery