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.

I'm looking for a very simple, lightweight SMTP server to run on an Ubuntu 9.04 VPS.

The only functionality I need is to support the PHP mail command;

<?php
mail('caffeinated@example.com', 'My Subject', 'My message');
?>

That's all it needs to do. I do not need logging, POP3, IMAP or anything else for inbound mail - just simple plain text SMTP. The emails will not have file attachments.

Any suggestions gratefully received.

share|improve this question

migrated from stackoverflow.com Aug 7 '11 at 12:33

This question came from our site for professional and enthusiast programmers.

7 Answers 7

I suggest you just use Postfix.

It's not minimal as you might want but:

  • It gets security updates in Ubuntu;
  • It's the default mail server, so you'll have all the distribution-specific troubleshooting guides you might need;
  • It sends mail trough secure connections.

The functions you don't need won't affect the ones you need anyway, and it's not like one megabyte of disk space is a problem - at least in a context where it's okay to install a behemoth sugh as Ubuntu.

share|improve this answer
    
Agreed on Postfix, especially on Ubuntu as you can chose to configure it for SMTP delivery only. –  pauska Aug 7 '11 at 12:38

I use sSMTP to relay mail through a Google Apps e-mail account on a Gentoo-based Linode VPS running Apache with mod_php. Since it's an outbound only sendmail replacement that only relays to other servers for them to actually deliver the mail, this sounds like the ideal request.

share|improve this answer
    
+1 sSMTP is great for these kind of situations. –  kce Aug 7 '11 at 19:05

I recommend msmtp, which is not a running service or full-fledged mail transport agent like postfix or exim, but rather a single executable that does outbound mail only. It is very easy to setup.

The one thing you lose over using a real SMTP service is that msmtp will not keep trying to deliver mail when the receiving server cannot be reached. It is for one-off outbound messages.

share|improve this answer

Try configuring PHP to connect directly to your mail relay. For your use I don't believe you need a mail server. You will need to install the php-mail package and configure it to use SMTP.

Make sure the domain you are sending mail from has an MX record. If the domain has an SPF record, make sure your mail relay is allowed to send mail on its behalf.

Any of the light weight relay only servers like eSMTP, mSMTP or sSMTP should be sufficient for your needs.

share|improve this answer

I had this same question. I answered it here. http://serverfault.com/a/184161/36671

share|improve this answer

Ubuntu "fully supports" two mail transfer agents:

  1. Postfix
  2. exim4

Both are a bit more capable than what you need.

share|improve this answer

I would recommend exim4. It's configuration is probably the easiest from the classic trio of sendmail, postfix and exim. Also leaves small footprint. We use it on our webservers for exactly the same purpose

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.