For most Rails projects you are going to use Sendgrid, Postmark, AWS SES, etc. I also have knowledge about IP reputation, warming, SPF, DKIM, DMARC, etc.
However you are always hostage of some cloud provider to deliver your emails.
What if you want to use only on your own infrastructure/servers to send the emails (e.g. because you have large volumes)?
I see that the only option for sending from your own server in ActionMailer is using sendmail: basically Ruby will invoke an external command for each email.
Why is that necessary? Why not send directly from Ruby code (e.g. connecting to the SMTP server of the recipient in a background job)?
Hi Marco, integrating a Mailserver into the default rails package, i would see as a overkill. If something like Postal would be available as a gem, that you could optionally plug-in could be a nice idea for apps that should be able for a fully-mail support including receiving emails. But such a gem would need heavy maintenance. May the day come if the demand is big enough
You say, you know about SPF, DKIM, DMARC etc. probably reverse DNS lookup?
Then you know how hard it is to convince a modern mail server, to accept incoming mail.
You normally have some mail service (you need a valid sender address) so my advice: use a authenticated account at this service to send your mails.
Otherwise most mail server, especially big ones like Google, GMX will reject your mails.
@mameier I know that the easiest solution is to use a service like Sendgrid, Postmark, AWS SES, etc. and I do that all the time.
However my question here is more about if it’s possible to be independent from these cloud providers. I would be happy to hear from people that made it and are sending from their own servers.