I am using actionmailer to send registration verification details of devise to users but I am getting following error:
Net::OpenTimeout in Users::RegistrationsController#create
my development.rb looks like:
config.action_mailer.default_url_options = { :host => 'http://localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'smtp.gmail.com',
:port => 25,
:domain => 'gmail.com',
:user_name => 'example@gmail.com',
:password => 'secret',
:authentication => 'plain',
:enable_starttls_auto => true,
:ssl => true
}
I use this question and added
#disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
command:
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
return 1. It didn't make difference to my error. Also tried changing port from 587 to 2525. So I tried establish connection with server from command line:
telnet smtp.gmail.com 2525
got:
Trying 74.125.68.108...
Trying 74.125.68.109...
Trying 2404:6800:4003:c02::6c...
telnet: Unable to connect to remote host: Network is unreachable
I even tried adding firewall rules using this. I followed second method (ufw) but I am still getting same error.