Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

7 Answers 7

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!

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

Have you tried esmtp?

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

Configuring mail for PHP.

share|improve this answer

happened to see this on How-to Forge today

share|improve this answer
    
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
up vote 1 down vote accepted

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:

http://sudhanshuraheja.com/2009/02/slicehost-setup-outgoing-mail-google-apps-postfix/

Thanks again.

share|improve this answer

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)

done.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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