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


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.


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!


If you're just sending out mail, you might be able to give nullmailer a try, it's in the Ubuntu extras repository on Jaunty (aptitude "show" output):

Package: nullmailer
Description: simple relay-only mail transport agent
 Nullmailer is a replacement MTA for hosts, which relay to a fixed set of smart
 relays. It is designed to be simple to configure and especially useful on slave
 machines and in chroots. 

 The sendmail interface of this package doesn't provide the -bs switch, hence
 it's not LSB compatible!
Homepage: http://untroubled.org/nullmailer/

Link to the project homepage: here


You will still require a valid SMTP server to be used with ssmtp. Once you configure ssmtp to talk to the up-stream SMTP server, it will relay all your email through that server. This will usually be your ISP server or 3rd party SMTP server.


Have you tried esmtp?

Its syntax is sendmail compatible. It's in the Ubuntu repositories.

Configuring mail for PHP.


happened to see this on How-to Forge today

  • I believe he was looking for something 'relatively easy'. :) – Luke Oct 13 '09 at 3:47
  • step-by-step instructions isn't easy? =) – Greeblesnort Oct 13 '09 at 4:22

Thanks everyone for teaching me a few things. I tried almost everyone's solution and I feel kind of embarrassed. I uninstalled the packages that I was working and installed postfix. With very little work I had something going.

Here's the link to the page that I found:


Thanks again.


Postfix is pretty nice. it installs nicely from repositories, and it has a clean config in only two files.

for sending only..

apt-get install postfix.

select internet host when it prompts you,

enter the proper hostname (should resolve back with reverse dns)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.