Sign up ×
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

closed as primarily opinion-based by fukawi2, Jenny D, Jim B, kasperd, Sven Sep 19 at 1:22

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

You don't need a mail server at all. Rails Action Mailer can talk to Gmail directly. –  Michael Hampton Sep 17 at 2:56

4 Answers 4

I have no experience with mail, so I need a server which is extremely easy to set up.

There is no mail server software that meets this criterion. If you want to setup email sending from your app without being blacklisted, use a service.

I use Mailjet. It has the best free plan IMO.

I also like Mandrill, Mailgun, Postmark. Sendgrid looks pro but expensive. But seriously, if you don't know a ton about linux admin, setting up an email server is an exercise in futility. And one misstep, then you start getting blacklisted, then it's all over (you'll have to change the IP addresses of all your sending servers).

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.

I don't know why this is downvoted. This is the only viable option for a linux mail admin noob. That, spend the (copious) hours, or hire someone who knows what they're doing.

share|improve this answer
+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
The OP clearly stated that he intends to relay everything through Gmail already. While the other services are certainly useful, they aren't really necessary here. –  Michael Hampton Sep 17 at 2:55

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/ 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 (which was somewhat wrong-headedly advised by the bat book) - something I have not been doing since the good ole 90s. Use your distro, 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

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

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

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