0
I am trying to configure my iptables firewall (currently rejecting all traffic) to allow emails traffic. For SMTP port 465 is used (SMTPS port), and for IMAP it uses port 143. But whatever I try, I cannot get a connection to work. Here are my iptables rules:
-A INPUT -p tcp --dport 143 -j ACCEPT
-A INPUT -p tcp --dport 993 -j ACCEPT
-A INPUT -p tcp --dport 465 -j ACCEPT
-A INPUT -p tcp --dport 25 -j ACCEPT
-A OUTPUT -p tcp --sport 465 -m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp --sport 143 -m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp --sport 993 -m state --state NEW,ESTABLISHED -j ACCEPT
I can easily get ssh connections to run with my other iptables rules, so I must be missing something here. Any ideas?
Are these rules for an e-mail server? You don't need the
INPUT
chain rules for a client. DefaultDROP
policy for theOUTPUT
chain are unnecessary for most desktop/client computers and often complicate things. Try changing the default policy toACCEPT
for theOUTPUT
. Lastly, maybe there's something wrong with the server-side or your client configuration. – Larssend – 2015-07-13T17:34:27.520The rules are for my email client, not a server. I have deleted the OUTPUT rules specified above, and I have changed the default OUTPUT policy to accept. Still it does not work. If I remove all restrictions/iptables I can connect to the email server, so my client is configured correctly. It must be something related to the iptables that is causing the problem. – Kohoutek – 2015-07-14T00:31:19.950