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.

link|improve this question

29% accept rate
feedback

3 Answers

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

link|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. – SvenW 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
feedback

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.

link|improve this answer
feedback

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:

define(SMART_HOST',smtp.gmail.com')

or whatever google says you must use]

# chkconfig sendmail on

# service sendmail start

Cheers.

link|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
1  
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
show 2 more comments
feedback

Your Answer

 
or
required, but never shown

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