Just use the following steps to configure iptables as per your requirement.
======================================================
iptables -P INPUT DROP
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i <LAN Interface> -p tcp -m tcp --dport 22 -j ACCCEPT
iptables -A INPUT -i <LAN Interface> -p tcp -m tcp --dport 3128 -j ACCCEPT
iptables -A INPUT -i <LAN Interface> -p tcp -m tcp --dport 25 -j ACCCEPT
iptables -A INPUT -i <LAN Interface> -p tcp -m tcp --dport 110 -j ACCCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -t nat -A POSTROUTING -i <LAN Interface> -o <WAN Interface> -j MASQUERADE
======================================================
Line 1 will drop all the traffic. make sure you will have physical access of the server
Line 2 will inspect the traffic statefully.
Line 3 will allow SSH, Line 4 Proxy, Line 5 SMTP , and Line 6 will allow POP3.
Line 7 will allow all local generated traffic.
Line 8 will masquerade all traffic of SMTP and POP3 to the desalinated server.
Note :
1. Before applying these rules make sure you have physical access of server
2. Make sure you have no other services like HTTP or FTP or SMB served by the server. If any service are running on this server should be allowed in IPTABLES.
3. Make sure you are not overriding your current IPTABLES rules.
4. Make sure You test all rules before saving it permanently.