dynamic ip and mail port updates
[distro-setup] / mail-route
index 11f92c60513709bd9b400bb61a00879745034edd..428972094d11ccff467d48d03b416a364e6127ec 100755 (executable)
@@ -21,7 +21,7 @@ usage() {
   cat <<'EOF'
 Usage: mail-route up|down|show
 
-Marks tcp packets on port 25 and 143 to be routed through
+Marks tcp packets on port 25, 143 and 587 to be routed through
 a vpn ip. If called from --up/--down in openvpn, (we have multiple args) $1 is the
 tun_dev, and action is from $script_type.
 
@@ -115,7 +115,7 @@ iptmod() { #iptables modify
 modify() {
   # match source or dest port. note, when we send to a port, it picks a random high port as
   # the source.
-  for port in 25 143; do # smtp and imap.
+  for port in 25 143 587; do # smtp and imap.
     iptcommon="OUTPUT -m tcp -p tcp -m multiport --ports $port -j MARK --set-mark"
     iptmod iptables -t mangle $iptables_op $iptcommon 0x1
     iptmod iptables -t mangle $iptables_op $iptcommon 0x0 -d 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16