Transparent Proxy SMTP rule for SnapGear

Catch outbound SMTP and redirect to ISP
Laptop users always have problems with their outbound SMTP settings.
Using IPTABLES you can catch the traffic and redirect to your ISP.
Following are the additional rules you may add to a CyberGuard SnapGear Firewall appliance to proxy the outbound smtp.
iptables -t nat -N SmtpProxy iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j SmtpProxy iptables -t nat -A SmtpProxy -p tcp -j DNAT --to-destination 61.9.168.243
If you want to make an exception to the above rule, i.e. don't use SmtpProxy for 1.2.3.4 set the rules like below:
iptables -t nat -N SmtpProxy iptables -t nat -A PREROUTING -i eth0 -d 1.2.3.4 -j RETURN iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j SmtpProxy iptables -t nat -A SmtpProxy -p tcp -j DNAT --to-destination 61.9.168.243

other Firewall Tips...