User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

1.) Install the MTA package on your Ubuntu 12.04 GNU/Linux box:

sudo apt-get install exim4-daemon-light

2.) Configure the MTA with this command and steps, replacing with your mail domain name:

sudo dpkg-reconfigure exim4-config

  • Set postmaster email:
  • Select 'mail sent by smarthost; no local mail'
  • Set at the "System mail name" screen
  • Set defaults(hit enter) until you get to the step below
  • Enter for the "IP address or host name of the outgoing smarthost:"
  • Set defaults all the way to the finish

That's it! exim4 should restart and you'll be ready to test. Now wasn't that easy?

Now check if the smtp server is listening on port 25 (smtp) with these terminal commands:

netstat -ano |grep :25

Should see something like:
tcp 0 0* LISTEN off (0.00/0/0)

Test the setup by sending an email to yourself from the Terminal:

echo "Yay - SMTP works" | mail -s "Test email"