[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
howtos:network_services:postfix_dovecot_mysql:email_firewall [2015/03/08 09:30 (UTC)] – Errata, updates astrogeek | howtos:network_services:postfix_dovecot_mysql:email_firewall [2015/06/10 08:10 (UTC)] – typo fix and clarification of example firewall.rules file tim | ||
---|---|---|---|
Line 9: | Line 9: | ||
<note important> | <note important> | ||
You should first use iptables -L to check for pre-existing rules and merge those below into your existing firewall. | You should first use iptables -L to check for pre-existing rules and merge those below into your existing firewall. | ||
- | If you have no existing firewall and need to allow http and ssh, uncomment the liines | + | If you have no existing firewall and need to allow http and ssh, uncomment the lines for those also included here.</ |
Following is a minimal set of iptables rules to provide a firewall for your email server. | Following is a minimal set of iptables rules to provide a firewall for your email server. | ||
Line 54: | Line 54: | ||
Ports 993 and 995 provide secure Imap and Pop3, respectively. These must be open in order for your virtual users to be able to send and receive email. | Ports 993 and 995 provide secure Imap and Pop3, respectively. These must be open in order for your virtual users to be able to send and receive email. | ||
- | To install these rules as your firewall save them to a text file then load that file using iptables-restore. This will replace any currently existing iptables rules with those in the file. | + | To install these rules as your firewall save them to a text file using < |
+ | |||
+ | < | ||
+ | < | ||
+ | :INPUT DROP [0:0] | ||
+ | :FORWARD DROP [0:0] | ||
+ | :OUTPUT ACCEPT [0:0] | ||
+ | </ | ||
+ | and to the end of the file, add < | ||
+ | As per the note above, don't forget to uncomment the ssh rule if the server is not sitting in front of you, or you'll lock yourself out!</ | ||
There are many preferences for saving and loading firewall scripts. I generally use / | There are many preferences for saving and loading firewall scripts. I generally use / |