Search Our Database

Firewall Rules for Script Mailer with Gmail SMTP

Last updated on |
by

1.) Most of our IPServerone Linux servers are implemented with the same firewall rules and having highly restriction on allowing outbound port for user apache.

2.) Hence for users that are using scripting mailer to blast out emails with Gmail SMTP, the system administrator would need to add additional firewall rules to allow port 465 and port 587 which is the port of Gmail SMTP.

3.) The system administrator will need to SSH into the server and edit the firewall rules by

[root@testserver ~]# vi /sbin/fwup

Search for firewall rules with “–uid-owner apache” and add the below rules under same category

/sbin/iptables -A OUTPUT -p tcp --dport 465 -m owner --uid-owner apache -j ACCEPT
/sbin/iptables -A OUTPUT -p tcp --dport 587 -m owner --uid-owner apache -j ACCEPT

4.) Rerun the firewall by running the below command

[root@testserver ~]# /sbin/fwup &