# Using multiple SMTP servers with Rails - avoiding blacklisting

**URL:** <https://www.ruby-forum.com/t/using-multiple-smtp-servers-with-rails-avoiding-blacklisting/172188>\
**Category:** Rails\
**Created:** [July 16, 2009, 2:44pm UTC](https://www.ruby-forum.com/t/using-multiple-smtp-servers-with-rails-avoiding-blacklisting/172188 "2009-07-16T14:44:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@trevor](https://www.ruby-forum.com/u/trevor)\
**Post date:** [July 16, 2009, 2:44pm UTC](https://www.ruby-forum.com/t/using-multiple-smtp-servers-with-rails-avoiding-blacklisting/172188/1 "2009-07-16T14:44:47Z")

</div>

Our application sends out a few hundred non-spam, opt-in only emails  
per day. Essentially they are order receipts, account activation  
notices, and other instructions that the customers expect to receive  
when they use the service.

We have had a constant problem with our providers (three of them now)  
not taking care of their blacklists - they host a few spammers that  
end up getting the entire network block, if not the entire ISP  
blacklisted. What this means for us is that we can’t ever reliably  
send email as we get rejected via blacklists that we aren’t supposed  
to be on, which means ultimately our service is not reliable.

Our strategy is to use redundant servers to try to send the email -  
first directly from our server, then if it gets rejected, use an  
outsourced SMTP provider that should hopefully be on top of their  
blacklists.

I know you can set SMTP servers in the Rails config, but is there a  
facility to allow Rails to connect to the server and know right away  
if it’s going to be rejected, and then go to the next SMTP server down  
the list so that we can assure that the email gets delivered?

Unfortunately our efforts to remove our specific IP from the  
blacklists, or get whitelisted, have failed, so our only idea at this  
point is to use multiple servers to try to deliver the email. We spoke  
with Rackspace Apps (who hosts our POP/IMAP at the moment) about this,  
but they gave us some nonsense about we _can_ use their SMTP if we  
want but they won’t tell us how many we can send per day, and can  
guarantee nothing as far as whether we can continue to use their  
servers to reliably deliver email. They pretty much just pushed me off  
the phone as if I was another spammer trying to use their servers.

Anyone else run into these issues and found a good solution? Thanks  
for any help!

---

<div class="post-metadata">

**Author:** ![trevor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@trevor](https://www.ruby-forum.com/u/trevor)\
**Post date:** [July 17, 2009, 2:57am UTC](https://www.ruby-forum.com/t/using-multiple-smtp-servers-with-rails-avoiding-blacklisting/172188/2 "2009-07-17T02:57:41Z")

</div>

> Anyone else run into these issues and found a good solution?

Yes, get a real ISP. It’ll be much simpler than the kludge you’re  
proposing. An alternative would be a hire a competent sysadmin to set  
up your own SMTP server and antispam DNS records.

-eric

---

<div class="post-metadata">

**Author:** ![trevor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@trevor](https://www.ruby-forum.com/u/trevor)\
**Post date:** [July 25, 2009, 11:30pm UTC](https://www.ruby-forum.com/t/using-multiple-smtp-servers-with-rails-avoiding-blacklisting/172188/3 "2009-07-25T23:30:14Z")

</div>

Thanks for the reply.

We have a real ISP. I’d love to hire a sys admin and maintain a  
separate SMTP server if we had unlimited money and time, but that’s  
kind of overkill. It’s enough for us to maintain the app servers.

However I did find in another thread someone recommending a service  
called AuthSMTP to deliver the mail. I spoke with them and they make  
sure everything is configured properly in the DNS and also take care  
of their servers and manage their blacklists. Only problem is we lose  
the ability to change the “from” address to private label the emails  
for our customers, but that may be affecting reliability anyway.

Still curious however if it would be possible to have multiple  
redundant SMTP servers - even with our own SMTP server or an  
outsourced service, if either were blacklisted or unavailable for a  
short time, email would be lost. Has anyone set up something like this  
in Rails before?
