Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should raise_delivery_errors be set to true in a production Rails app?

The default in Ruby on Rails is to have this set to false (in production and development).

config.action_mailer.raise_delivery_errors = false

Seems strange. I'm definitely turning it on in development which has been helpful. But why does no one seem to have this turned on in production? Shouldn't we want to get notified if an email doesn't go through? This seems rather important.

The rails comment in production.rb states

bad email addresses will be ignored

But I have some validation to check incorrect email addresses. It seems like I'd still want to know (via exception notifier or otherwise) how often users aren't getting emails.

like image 397
Brian Armstrong Avatar asked May 16 '09 02:05

Brian Armstrong


1 Answers

the real question is do you want a failed email to throw an error to your end user? Perhaps the mail server is down or a handful of other reasons prevent the email from being sent. Do you want this to throw a 50x error to your user?

Personally, I deliver all email asynchronously so I can monitor this type of stuff (plus it helps greatly in response times)

like image 168
cpjolicoeur Avatar answered Oct 03 '22 04:10

cpjolicoeur