NYULibraries/spatial_data_repository

Email record function fails and displays 500 internal server error

nmwolf opened this issue · 3 comments

Option to email record to oneself or colleague does not work. After clicking on "Email" a popup window appears as expected, and one can enter destination email and message and click Send. However, email is not sent and following error appears:

Image

It appears this is cause by an SSL Cert issue:

OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 peeraddr=XX.XX.XX.XX:25 state=error: certificate verify failed (Hostname mismatch))

This can be resolved by updating the cert or setting ActionMailer's openssl_verify_mode to 'none'.

It's probably best to try and update the cert.

Here are options for resolving this issue, in order of preference by me.

Switch ActionMailer’s Delivery method from SMTP to Sendmail

Since we’re sending mail from the machine the Rails app is running on we could just use sendmail. It’s installed on both the staging and production server.

We’d add the following line to config/environments/production.rb:

config.action_mailer.delivery_method = :sendmail

And then deploy the app to Staging, confirm it works and then deploy to Production.

Fix the SSL Cert Issue

This is the option I know the least about and would need to lean on Derrick for this.

Turn off ActionMailer’s openssl_verify_mode

This seems to be the most suggested and most argued solution - it’s considered a security concern for production environments.

This was addressed by #331