Configuring an e-mail server for local testing on ubuntu is a really fast an easy task. You just need to install and configure sendmail with these commands:

sudo apt-get install sendmail
sudo sendmailconfig

The first command gets and installs sendmail from ubuntu repositories. The second command will run a configuration script that will ask you some questions about your configuration.

After you do this you have to add a fully qualified domain name to your hosts file or your server will not work.

Your hosts file should have something like this:


You can really write the domain name you want but it needs to be fully qualified, that means it should contain a top level domain, in my example dev.

[ apache  linux  ]
Socket Statistics with ss
Making your local server accessible from anywhere
PHP Warning: date(): It is not safe to rely on the system's timezone settings
sudo: unable to resolve host
Local Apache and OpenSSL configuration