I have an app running Rails 4.2.0, Devise 3.4.1 and the latest version of the postmark-rails gem. At first sending a reset password mail seemed to work fine, but I never received the mails.
Then I changed config.action_mailer.raise_delivery_errors = true
(it was false), which revealed the following error:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Note that this is on my development machine.
I have implemented my mailer as described here, but here are the relevant bits:
IN /app/mailers/user_mailer.rb:
class UserMailer < ActionMailer::Base
include Devise::Mailers::Helpers
default from: "xxx@xxx.xxx" # <- From address replaced by x's
def confirmation_instructions(record)
devise_mail(record, :confirmation_instructions)
end
def reset_password_instructions(record,token,options)
devise_mail(record, :reset_password_instructions)
end
def unlock_instructions(record)
devise_mail(record, :unlock_instructions)
end
end
Then in development.rb:
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.perform_deliveries = true
In /initializers/devise.rb:
config.mailer = 'UserMailer'
application.rb: ( i have both of these ENV variable available to my app)
config.action_mailer.delivery_method = :postmark
config.action_mailer.postmark_settings = { :api_key => ENV['POSTMARK_API_KEY'], :api_token => ENV['POSTMARK_API_TOKEN'] }
Gemfile:
gem 'postmark-rails'
gem 'mail'
I have found many references to this SSL error, but couldn't find anything that I feel applies to this.
Please help?
UPDATE: From various resources on the web, mainly this one, I suspect that the source of my problem may be that I'm using the older version of OpenSSL that ships with the current version of GIT for Windows. My app works when deployed to Heroku.