Merge pull request #5700 from mailcow/staging

[Netfilter] fix mailcow isolation rule for iptables
This commit is contained in:
Niklas Meyer 2024-02-02 17:49:49 +01:00 committed by GitHub
commit 20c90642f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -219,7 +219,7 @@ class IPTables:
# insert mailcow isolation rule # insert mailcow isolation rule
rule = iptc.Rule() rule = iptc.Rule()
rule.in_interface = f'! {_interface}' rule.in_interface = f'!{_interface}'
rule.out_interface = _interface rule.out_interface = _interface
rule.protocol = 'tcp' rule.protocol = 'tcp'
rule.create_target("DROP") rule.create_target("DROP")
@ -234,7 +234,7 @@ class IPTables:
if _allow != "": if _allow != "":
rule = iptc.Rule() rule = iptc.Rule()
rule.src = _allow rule.src = _allow
rule.in_interface = f'! {_interface}' rule.in_interface = f'!{_interface}'
rule.out_interface = _interface rule.out_interface = _interface
rule.protocol = 'tcp' rule.protocol = 'tcp'
rule.create_target("ACCEPT") rule.create_target("ACCEPT")