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 am looking for a small footprint (in terms of processor cycles) Mail Transfer Agent for a Linux box. The box is actually a VPS server hosted at Linode. I am building the server to replace all the services that are currently delivered on a shared hosting account. I am running a basic LAMP server. One of my web applications sends emails to users and I have any return emails piped to a php script. All I'm looking for is something lightweight that I can easily configure to pipe these emails to a php script. If it can also act as an outgoing smtp server that would be great too.

I currently have the server running ubuntu 8.04 LTS, but I am not that far down the road, and have many choices if there is a better one for this situation.

share|improve this question
add comment

4 Answers

up vote 2 down vote accepted

most mta are light enough for any 128meg vps. what make them big usually are the antispam/virus system like spamassassin, clam,etc..

so, if you only need outgoing mail, just install any of exim/postfix/sendmail will be fine.

but if you need incoming mail, you will need good antivirus/antispam. for this, i actually recommend you use cheap cpanel hosting to handle the email and let the vps only do the web.

just like how i usually did it: http://wiki.dennyhalim.com/the-perfect-webserver

share|improve this answer
    
the cheap cpanel hosting is something that I have considered, but it complicates life in that I would have to maintain the php script on that server and have that server access the database on my main server. As for the spam stuff, do I really need it? The incoming mail I will be dealing with is very limited in scope and I can simply drop everything that does not meet my criteria. –  Scott Oct 19 '09 at 14:01
    
if you're absolutely sure you can just dump all other mail, then you can just do that. just make sure you have some simple light antispam like postgrey to make sure your mail server does not load your cpu to the sky... without the heavy spamassassin/clam/etc, any mail server is usable on any 128meg vps. –  DennyHalim.com Oct 20 '09 at 2:27
    
I know this is years old, but the above comment needs a status update. Don't continue using greylisting, it's become almost completely ineffective at reducing spam volume. The spammers just simply updated their email clients, once everyone started greylisting, it was bound to happen. For a very lightweight spam reducing method, I recommend using a high quality DNSBL. –  TechZilla May 30 '13 at 15:58
add comment

I usually install ssmtp, its simple, lightweight and has practically no deps

See this post, for example, to have an idea of its configuration.

Why I have chosen ssmtp? Simply because it was what I found to be the one having less dependencies among other MTA I inspected. In a minimal install I can always minimize packages installed having ssmtp. exim and others are light enough, but have more dependencies.

share|improve this answer
1  
+1, AFAIK, ssmtp is the only one designed for this usecase (a server that sends emails, no need for UI, no receive messages, no forwarding, etc). with a 40KB binary and no running daemon is very hard to beat in terms of resources –  Javier Oct 19 '09 at 15:17
    
except that I think he NEEDS inbound email piped to a script. –  Trevor Harrison Oct 19 '09 at 16:18
    
You are right, not read this point. Ok, even if having mail handled by a web server is not so beautiful IMHO. –  AlberT Oct 19 '09 at 16:34
1  
ssmtp requires that another server actually delivers the message. It also requires that the plaintext password for the smtp server is kept in its config file. –  Unode Apr 23 '13 at 16:14
add comment

You may stick to exim, which is part of the default installation.

See http://serverfault.com/questions/73769/simple-mail-system-for-ubuntu/73828#73828 for a procedure to configure outgoing mail -- you want to configure an "internet site; mail is sent and received directly using smtp".

To enable mail delivery to your script through a pipe, edit /etc/aliases and add something like

myscript: |/usr/local/bin/myscript

and create /etc/exim4/conf.d/main/00_enable_pipe_transport with this contents:

SYSTEM_ALIASES_PIPE_TRANSPORT=address_pipe

restart exim (/etc/init.d/exim4 restart) and you are good to go.

share|improve this answer
add comment

Consider using xmail for this. Don't use the included software just because it is there. You will likely be setting up other servers in the future, and if you need to have a lightweight email server in your toolkit, it is best to pick one that does the job, learn it, and install it whenever you need one.

share|improve this answer
add comment

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.