Setup a local only, forwarding Mail Server (Linux, Unix, Mac)
1 - Point localhost.com to your machine
Most of programs will not accept an email using just @localhost as domain.
/etc/hosts file to make the domain localhost.com point to your machine by adding this line to the file:
To make the change, open the /etc/hosts file using nano or your favorite text editor.