title: iptables allow whm mail port 25
body: <p>Trying to understand iptables (I have cPanel installed on VPS) and having a little play so may sound like a silly question what I am doing.</p>
  
  <p>I have copied the default iptables config to backup (in case goes wrong to restore) and created custom iptables config (/etc/sysconfig/iptables) were I DROP INPUT/OUTPUT/FORWARDING (so everything). </p>
  
  <p>I then managed to get all the ports I want access to required working (incoming/outgoing HTTP/s/SSH/FTP etc) apart from emails (:25). I am using Roundcube and using the below config for emails but emails can not be sent/received on my server (works if I restore default config (ACCEPT everything) so apart from port :25 is there any other ports I need to allow access to for mail to be sent knowing everything has been dropped?). I am using below config for email in my custom (/etc/sysconfig/iptables):-</p>
  
  <pre><code>-A INPUT -p tcp --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT
  -A OUTPUT -p tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT
  
  -A OUTPUT -p tcp --dport 25 -j ACCEPT
  -A INPUT -p tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT
  </code></pre>