Skip to content

Commit 44172d9

Browse files
committed
Extract TLS undecided policy from 'postfix_tls'
1 parent d18bb8c commit 44172d9

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

50-filter-postfix.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ filter {
297297
"postfix_delay_transmission", "float",
298298
"postfix_postscreen_violation_time", "float"
299299
]
300+
gsub => [
301+
# rewrite some extracted values
302+
"postfix_tls_policy_undecided", "\?", "true"
303+
]
300304
}
301305
}
302-

postfix.grok

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ POSTFIX_VERIFY_CACHE cache %{DATA} (?<postfix_verify_cleanup_type>(full|partial)
122122
POSTFIX_LOCAL_DELIVERY %{POSTFIX_KEYVALUE} status=%{STATUS_WORD:postfix_status}( \(%{GREEDYDATA:postfix_local_response}\))?
123123

124124
# TLS features
125-
POSTFIX_TLS_FEATURES %{STATUS_WORD:postfix_tls_security_level}(:%{STATUS_WORD:postfix_tls_downgrade_level})?
125+
POSTFIX_TLS_POLICY_UNDECIDED \?
126+
POSTFIX_TLS_FEATURES %{STATUS_WORD:postfix_tls_security_level}(:%{STATUS_WORD:postfix_tls_downgrade_level})?(%{POSTFIX_TLS_POLICY_UNDECIDED:postfix_tls_policy_undecided})?
126127

127128
# aggregate all patterns
128129
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}

test/tls_features_0009.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pattern: "^%{POSTFIX_TLS_FEATURES}$"
2+
data: "may?"
3+
results:
4+
postfix_tls_security_level: may
5+
postfix_tls_policy_undecided: "?"

test_pipeline.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ perform_cleanup() {
2323
trap perform_cleanup INT TERM
2424

2525
echo Preparing input data
26-
echo "postfix/smtp[123]: 7EE668039: to=<admin@example.com>, relay=127.0.0.1[127.0.0.1]:2525, delay=3.6, delays=0.2/0.02/0.04/3.3, dsn=2.0.0, tls=dane:none/!requiretls:nostarttls, status=sent (250 2.0.0 Ok: queued as 153053D)" > "$INPUT"
26+
echo "postfix/smtp[123]: 7EE668039: to=<admin@example.com>, relay=127.0.0.1[127.0.0.1]:2525, delay=3.6, delays=0.2/0.02/0.04/3.3, dsn=2.0.0, tls=dane?, status=sent (250 2.0.0 Ok: queued as 153053D)" > "$INPUT"
2727

2828
echo Preparing pipeline config
2929
cat > "$PIPELINE" << EOF

0 commit comments

Comments
 (0)