home · contact · privacy
Add mail server setup scripting.
[config] / buster / etc_files / mail / etc / nftables.conf
1 #!/usr/sbin/nft -f
2
3 flush ruleset
4
5 table inet filter {
6         chain input {
7                 type filter hook input priority 0; policy drop;
8                 iif lo accept comment "accept localhost traffic"
9                 ct state invalid drop comment "drop invalid connections"
10                 ct state established, related accept comment "accept traffic originated from us"
11                 tcp dport 22 accept comment "accept SSH on default port"
12                 tcp dport 25 accept comment "accept SMTP (allowing for STARTTLS); necessary for mail server to mail server banter, i.e. for receiving mails"
13                 tcp dport 80 accept comment "accept HTTP; necessary for Certbot HTTP challenge"
14                 tcp dport 465 accept comment "accept SMTPS; for mail user agent to mail server, i.e. for sending mails"
15                 tcp dport 993 accept comment "accept IMAPS; for reading/downloading mails"
16                 ip protocol icmp icmp type echo-request accept comment "accept ICMP for pinging"
17         }
18         chain forward {
19                 type filter hook forward priority 0; policy drop;
20         }
21         chain output {
22                 type filter hook output priority 0; policy accept;
23         }
24 }