Search Our Database

Firewall Rules for Script Mailer with Gmail SMTP

Last updated on |
by

Introduction

Most of our IP Serverone Linux servers are implemented with the same firewall rules and having highly restriction on allowing outbound port for user Apache. 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.

This guide will go through the steps on adding the rules in server firewall.

 

Prerequisite

  • Can access to server using root or have root privilege
  • Knowledge on SSH and Cli commands

 

  1. SSH into the server and type sudo -i if you are not login using root
  2. Edit the firewall rules by enter command below
    vi /sbin/fwup
  3. 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
    /sbin/fwup &

 

Important Notes

  • Wrongly configure the firewall may causing the services/applications in server having issue for running incoming or outgoing process.

 

Conclusion

By following the steps above, the outgoing port 465 and port 587 should be open and ready to use for outgoing process.

 

For additional assistance or if you encounter any issues, please contact our support team at support@ipserverone.com.