4

According to this guide:

It is important to secure your server and make sure that Postfix is not configured as an open relay.

It links to another guide which suggests using UFW as a firewall.

I'm running Apache on Ubuntu with a PHP application that needs to send email. I've installed postfix as my mail server.

I've configured UFW so far with:

sudo ufw allow ssh
sudo ufw allow www

To allow email out, would I tell UFW to allow smtp?:

sudo ufw allow smtp

Is there anything else I need to do to allow email to be sent out?

1 Answers1

5

Don't open your servers smtp port to the world. php should be sending mail using /usr/sbin/sendmail.

If you need to send out using a remote server, this Q&A may be of interest.

EEAA
  • 110,608
84104
  • 13,181
  • 6
  • 49
  • 80