Skip to content

Commit 138d07d

Browse files
fix: SMTPS transport for sender-dependant rules (#201)
Specific smtps_from transport that honors both TLS wrapper-mode and sender-dependant authentication rules. Fixes a 1.7 regression with Relay Rules on port 465. Note: the test suite currently does not provide SMTPS (port 465 with TLS-wrap) mock server for automatic tests. Refs NethServer/dev#7626
1 parent 13f67e2 commit 138d07d

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

postfix/etc/postfix/relaysender_transport.cf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#
2-
# relaysender_transport -- select special smtp_from transport,
3-
# if MAIL FROM matches a sender relay rule
2+
# relaysender_transport -- select special smtp/smtps_from
3+
# transport, if MAIL FROM matches a sender relay rule
44
#
55

66
dbpath = /srv/pcdb.sqlite
7-
query = SELECT 'smtp_from'
7+
query = SELECT transport || '_from'
88
FROM relayrules
99
WHERE enabled = 1 AND
1010
rule_type = 'sender' AND

postfix/usr/local/lib/templates/master.cf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ ${tmpl_sasl_commentout} -o smtpd_sender_restrictions=${tmpl_sender_restri
4545
-o smtpd_tls_auth_only=no
4646
smtps unix - - n - - smtp ${tmpl_debug_relay}
4747
-o smtp_tls_security_level=encrypt -o smtp_tls_wrappermode=yes
48+
smtps_from unix - - n - - smtp ${tmpl_debug_relay}
49+
-o smtp_sender_dependent_authentication=yes
50+
-o smtp_tls_security_level=encrypt -o smtp_tls_wrappermode=yes

tests/50__smtp/00__relay_rules.robot

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,20 @@ Sender address rule has medium priority
2121
... credentials=u3:Nethesis,1234
2222
Should be relayed via SMTP port=10002 smtp_user=usr_u3
2323

24+
Sender address rule honors TLS encryption
25+
[Tags] bug bug-7626
26+
Skip "Not implemented"
27+
2428
Sender domain rule has less priority than address match
2529
Send SMTP message to somebody@wildcard.test
2630
... from=noreply@inbound.test
2731
... credentials=u3:Nethesis,1234
2832
Should be relayed via SMTP port=10002 smtp_user=${EMPTY}
2933

34+
Sender domain rule honors TLS encryption
35+
[Tags] bug bug-7626
36+
Skip "Not implemented"
37+
3038
Sender domain rule provides the correct credentials
3139
[Tags] bug bug-7551
3240
Send SMTP message to somebody@wildcard.test

0 commit comments

Comments
 (0)