Simple Mail System for Ubuntu – Setup Guide

emailUbuntu

What I'm looking for should be relatively easy. All I want to do is setup something VERY small for Ubuntu that will allow me to use the mail() function in PHP from my web server (/var/www/). I don't want anything complex. I have a noreply@mybusiness.com type of email setup so if it is necessary, I can use that as a reply-to address. But I just want the ability to send mail, NOT receive any at my web server. Thanks

Will

By the way, I've tried exim4 (btw, which setting should I pick, if it's possible to do what i want?), and I've tried ssmtp, but have had no luck with ssmtp. Thanks.

Best Answer

Just do a

sudo dpkg-reconfigure exim4-config

and pick the "mail sent by smarthost; no local mail" option. Now for the options:

  • Specify a system mail name, specify to listen for incoming SMTP connections only on port 25 of localhost
  • Don't specify any other destionations for which mail is accepted
  • Specify subdomain.mybusiness.com as the visible domain name for local users.
  • Specify the IP address of your actual mail server -- that's the smarthost. If it requires authentication put the name of the server, your username and password in /etc/exim4/passwd.client

There you go: a complete mail setup for Debian/Ubuntu in under one minute!