I am using Ubuntu 16.04 LTS. I would like to setup a simple email server in my box, to test email sending and receiving capabilities of my application. I am looking for a simple-to-setup solution, which enable this capability. My expectations are;
sender@localhost
and receiver@localhost
A detailed, beginner level answer on how to setup or a beginner level tutorial link will be greatly helpful.
Thank you.
There are a number of important safety guards you need in place to run a mail server, primarily to prevent your system from becoming a spam relay and being used to target innocent users out on the Internet. Even running an email server locally can open you to these attacks unless you take the proper steps. Thankfully, there are a number of good configurations out there including Ububtu (and other platforms) which make this easy. I think this is what you're wanting:
https://gist.github.com/raelgc/6031274
Just follow the instructions for Ubuntu and it should work fine. It even has some safety notes built into the sample config to protect you from accidentally getting into trouble (like becoming an open relay, etc.).
Hope that helps.