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.
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.
nullmailer is written for exactly this purpose: Just relaying everything to another host.
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.
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:
to look like:
or whatever google says you must use]
# chkconfig sendmail on
# service sendmail start
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.