allow sending email through postfix

This commit is contained in:
jaina heartles 2025-03-09 22:58:22 -04:00
parent a88c13b4f6
commit 264d64526c

View file

@ -3,8 +3,11 @@
{ {
networking.firewall.extraCommands = let user = config.services.postfix.user; networking.firewall.extraCommands = let user = config.services.postfix.user;
in '' in ''
iptables -I OUTPUT -m owner ! --uid-owner ${user} -m tcp -p tcp --dport 25 -j REJECT --reject-with icmp-admin-prohibited iptables -A OUTPUT -m owner ! --uid-owner ${user} -m tcp -p tcp --dport 25 -j REJECT --reject-with icmp-admin-prohibited
ip6tables -I OUTPUT -m owner ! --uid-owner ${user} -m tcp -p tcp --dport 25 -j REJECT --reject-with icmp6-adm-prohibited ip6tables -A OUTPUT -m owner ! --uid-owner ${user} -m tcp -p tcp --dport 25 -j REJECT --reject-with icmp6-adm-prohibited
iptables -I OUTPUT -m tcp -p tcp --dport 25 -d 127.0.0.1 -j ACCEPT
ip6tables -I OUTPUT -m tcp -p tcp --dport 25 -d 127.0.0.1 -j ACCEPT
''; '';
services.postfix = { services.postfix = {