Skip to content

Commit 822f19e

Browse files
committed
Support parsing enhanced status codes that include larger integers.
Based on #161 and https://en.wikipedia.org/wiki/List_of_SMTP_server_return_codes#Enhanced_status_code
1 parent 7ca27c6 commit 822f19e

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
@@ -7,7 +7,7 @@ POSTFIX_RELAY_INFO %{HOSTNAME:postfix_relay_hostname}?\[(%{IP:postfix_relay_ip}|
77
POSTFIX_SMTP_STAGE (CONNECT|HELO|EHLO|STARTTLS|AUTH|MAIL( FROM)?|RCPT( TO)?|(end of )?DATA|RSET|UNKNOWN|END-OF-MESSAGE|VRFY|\.)
88
POSTFIX_ACTION (accept|defer|discard|filter|header-redirect|reject)
99
POSTFIX_STATUS_CODE \d{3}
10-
POSTFIX_STATUS_CODE_ENHANCED \d\.\d\.\d
10+
POSTFIX_STATUS_CODE_ENHANCED \d\.\d+\.\d+
1111
POSTFIX_DNSBL_MESSAGE Service unavailable; .* \[%{GREEDYDATA:postfix_status_data}\] %{GREEDYDATA:postfix_status_message};
1212
POSTFIX_PS_ACCESS_ACTION (DISCONNECT|BLACKLISTED|WHITELISTED|WHITELIST VETO|PASS NEW|PASS OLD)
1313
POSTFIX_PS_VIOLATION (BARE NEWLINE|COMMAND (TIME|COUNT|LENGTH) LIMIT|COMMAND PIPELINING|DNSBL|HANGUP|NON-SMTP COMMAND|PREGREET)

test/smtpd_0030.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: RCPT from 061238241086.static.ctinets.com[61.238.241.86]: 550 5.12.345 <[email protected]>: Recipient address rejected: Some error message; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<ecsolved.com>"
3+
results:
4+
postfix_queueid: NOQUEUE
5+
postfix_action: reject
6+
postfix_smtp_stage: RCPT
7+
postfix_client_hostname: 061238241086.static.ctinets.com
8+
postfix_client_ip: 61.238.241.86
9+
postfix_status_code: 550
10+
postfix_status_code_enhanced: 5.12.345
11+
postfix_status_data: [email protected]
12+
postfix_status_message: "Recipient address rejected: Some error message"
13+
postfix_keyvalue_data: from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<ecsolved.com>

0 commit comments

Comments
 (0)