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

I need to send emails from web application using Gmail accounts. As far as I understand, sending them directly will freeze worker process for quite a long time (it's a Rails app running on Apache/Passenger). So I want to install local SMTP server which will queue the message and send it using Gmail. I have no experience with mail, so I need a server which is extremely easy to set up.

share|improve this question

4 Answers 4

nullmailer is written for exactly this purpose: Just relaying everything to another host.

share|improve this answer
It'll hang doing the delivery, though, just like doing it directly. Nullmailer and sSMTP are really only useful for something that insists on calling /usr/sbin/sendmail and lacks SMTP capabilities itself. –  womble Aug 31 '11 at 10:45
Nullmailer has a queue so it won't block the calling application. But if the app requires an SMTP interface, not just the sendmail binary, it won't help. –  Sven Aug 31 '11 at 11:03
Well, knock me down with a feather, so it does. They need more marketing on that feature... –  womble Aug 31 '11 at 20:13

The easiest one to setup is whatever you're most familiar with. If you're not familiar with any of them, then the easiest is whatever the person you hire to setup your mail server is familiar with. Failing that, I use and recommend Postfix, which has decent documentation and plenty of examples out on the Internet. Other people might recommend Exim, and that's not too bad either.

share|improve this answer

The statement "I have no experience with mail" and sending bulk emails from web application, taken together, are really a recipe for grief (like being blacklisted for having unwittingly mailbombed some poor unsuspecting schmuck, etc.).

I don't want to preach, but you should really either get a good understanding of what you are getting into or find somebody who already has it.

This said, these days most servers are quite easy to set up for what you want to do. I am partial to sendmail/fedora/redhat/centos, so:

# yum -y install sendmail sendmail-cf

[edit /etc/sendmail.mc and change the line:

dnl define(SMART_HOST',smtp.your.provider')

to look like:


or whatever google says you must use]

# chkconfig sendmail on

# service sendmail start


share|improve this answer
Sendmail as answer to "easiest MTA to setup" is REALLY an interesting point of view. I guess you're maybe one of the handfull of people on plant earth that hold that view. Sendmail is known to make grown up man cry. –  pfo Aug 31 '11 at 12:00
You missed the ''for what you want to do'' bit. For that task, 4 shell commands are required, which counts as easy in my book. As far as sendmail being complex: easy it ain't, but most of the bad reputation comes from trying to tinker with sendmail.cf (which was somewhat wrong-headedly advised by the bat book) - something I have not been doing since the good ole 90s. Use your distro sendmail.mc, and the ugly syntax goes away.I know some other mail MTAs style themselves as easy - I have tried qmail and found it bewildering. But that's just me. –  Alien Life Form Aug 31 '11 at 14:39
Just to clarify further: the box set up as reccomended will either send right away or queue and then try to send through gmail's smtp smarthost any piece of mail that is locally submitted. Assuming you're allowed to do it; assuming google's server thinks you're in good standing; etc. –  Alien Life Form Aug 31 '11 at 14:51
Don't gmail's servers require authentication before they'll let you wildly relay through them? You're getting far beyond four shell commands for that... –  womble Aug 31 '11 at 20:15
The assumption seems reasonable. But then they also make you put stuff in the dns to verify ownership, so I'd have to read up on the FAQs to check and I'm too lazy for that. Assuming they do, and assuming it's sendmail 8.12 or later you need 1 shell command and 1 edit more [continued below] –  Alien Life Form Sep 1 '11 at 10:11

Simplest way to setup emailing from your webapp without being blacklisted:


They have a free plan that will last you until you start having to scale, then you won't mind paying them at that point anyway.

Seriously, we were landing in the Spam box all over the place until we switched over to them. If you don't enjoy spending 200+ hours familiarizing yourself with 1970s-era software and protocols, just use a service like Mailjet.

share|improve this answer
If you are set with using Gmail's servers, just set up your app to connect to their smtp servers directly. But keep in mind they have a cap at like 100 emails a day or something like that. It didn't take long for us to hit the ceiling and switch over to a drop-in replacement like Mailjet. –  Duke May 31 '12 at 19:46
+1 from me even if that annoys some. The advice to use a service (assuming the service is legit) if you dont want to mess with the gritty details is good. Otherwise, if you want to send locally: ssmtp is another good tool. just do not use non-queueing mailers like ssmtp, nullmailer to send to actual inbound MXes, you will get into issues with greylisting. –  rackandboneman May 31 '12 at 20:54

Your Answer


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.