Skip to content

Commit 96feba1

Browse files
authored
Merge pull request #165 from whyscream/support-warn-if-reject
Add support for parsing the result of a warn_if_reject configuration.
2 parents 5bff75d + 34ff633 commit 96feba1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

postfix.grok

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ POSTFIX_QUEUEID ([0-9A-F]{6,}|[0-9a-zA-Z]{12,}|NOQUEUE)
55
POSTFIX_CLIENT_INFO %{HOSTNAME:postfix_client_hostname}?\[%{IP:postfix_client_ip}\](:%{INT:postfix_client_port})?
66
POSTFIX_RELAY_INFO %{HOSTNAME:postfix_relay_hostname}?\[(%{IP:postfix_relay_ip}|%{DATA:postfix_relay_service})\](:%{INT:postfix_relay_port})?|%{WORD:postfix_relay_service}
77
POSTFIX_SMTP_STAGE (CONNECT|HELO|EHLO|STARTTLS|AUTH|MAIL( FROM)?|RCPT( TO)?|(end of )?DATA|RSET|UNKNOWN|END-OF-MESSAGE|VRFY|\.)
8-
POSTFIX_ACTION (accept|defer|discard|filter|header-redirect|reject)
8+
POSTFIX_ACTION (accept|defer|discard|filter|header-redirect|reject|reject_warning)
99
POSTFIX_STATUS_CODE \d{3}
1010
POSTFIX_STATUS_CODE_ENHANCED \d\.\d+\.\d+
1111
POSTFIX_DNSBL_MESSAGE Service unavailable; .* \[%{GREEDYDATA:postfix_status_data}\] %{GREEDYDATA:postfix_status_message};

test/smtpd_0031.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
pattern: ^%{POSTFIX_SMTPD}$
2+
data: "NOQUEUE: reject_warning: RCPT from example.com[93.184.216.34]: 553 5.7.1 <sender@example.com>: Sender address rejected: not owned by user ph123; from=<sender@example.com> to=<recipient@example.com> proto=ESMTP helo=<example.com>"
3+
results:
4+
postfix_queueid: NOQUEUE
5+
postfix_action: reject_warning
6+
postfix_smtp_stage: RCPT
7+
postfix_client_hostname: example.com
8+
postfix_client_ip: 93.184.216.34
9+
postfix_status_code: 553
10+
postfix_status_code_enhanced: 5.7.1
11+
postfix_status_data: sender@example.com
12+
postfix_status_message: "Sender address rejected: not owned by user ph123"
13+
postfix_keyvalue_data: from=<sender@example.com> to=<recipient@example.com> proto=ESMTP helo=<example.com>

0 commit comments

Comments
 (0)