# Problem in accessing SSL enabled mail server

**URL:** <https://www.ruby-forum.com/t/problem-in-accessing-ssl-enabled-mail-server/182078>\
**Category:** Rails\
**Created:** [January 22, 2010, 10:59am UTC](https://www.ruby-forum.com/t/problem-in-accessing-ssl-enabled-mail-server/182078 "2010-01-22T10:59:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Chaudhari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ea5d25/32.png) [@Rahul\_Chaudhari](https://www.ruby-forum.com/u/Rahul_Chaudhari)\
**Post date:** [January 22, 2010, 10:59am UTC](https://www.ruby-forum.com/t/problem-in-accessing-ssl-enabled-mail-server/182078/1 "2010-01-22T10:59:18Z")

</div>

Hi,

I have two different mail server servers. Both are SSL enabled.  
When I try to read mail from my mail box I got following error on 1  
machine,

Errno::ECONNREFUSED: Connection refused - connect(2)  
from /usr/lib/ruby/1.8/net/smtp.rb:551:in `initialize' from /usr/lib/ruby/1.8/net/smtp.rb:551:in`open’  
from /usr/lib/ruby/1.8/net/smtp.rb:551:in `do_start' from /usr/lib/ruby/1.8/timeout.rb:62:in`timeout’  
from /usr/lib/ruby/1.8/timeout.rb:93:in `timeout' from /usr/lib/ruby/1.8/net/smtp.rb:551:in`do\_start’  
from /usr/lib/ruby/1.8/net/smtp.rb:525:in `start' from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/ delivery_methods/smtp.rb:84:in`deliver!’  
from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/  
deliverable.rb:11:in `perform_delivery!' from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/mail.rb:122:in`deliver’  
from (irb):6

And for other machine

Net::POPAuthenticationError: -ERR only valid after entering TLS mode  
from /usr/lib/ruby/1.8/net/pop.rb:983:in `check_response_auth' from /usr/lib/ruby/1.8/net/pop.rb:883:in`auth’  
from /usr/lib/ruby/1.8/net/pop.rb:990:in `critical' from /usr/lib/ruby/1.8/net/pop.rb:882:in`auth’  
from /usr/lib/ruby/1.8/net/pop.rb:555:in `do_start' from /usr/lib/ruby/1.8/net/pop.rb:528:in`start’  
from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/  
retriever\_methods/pop3.rb:163:in `start' from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/ retriever_methods/pop3.rb:113:in`find’  
from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/  
retriever\_methods/pop3.rb:87:in `last' from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/ retrievable.rb:14:in` **send** ’  
from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/  
retrievable.rb:14:in `method_missing' from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/mail.rb:135:in`last’  
from (irb):7

if for second server (error) if I specify enable\_tls  
OpenSSL::SSL::SSLError: SSL\_connect returned=1 errno=0 state=SSLv2/v3  
read server hello A: unknown protocol  
from /usr/lib/ruby/1.8/net/pop.rb:541:in `connect' from /usr/lib/ruby/1.8/net/pop.rb:541:in`do\_start’  
from /usr/lib/ruby/1.8/net/pop.rb:528:in `start' from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/ retriever_methods/pop3.rb:163:in`start’  
from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/  
retriever\_methods/pop3.rb:113:in `find' from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/ retriever_methods/pop3.rb:87:in`last’  
from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/  
retrievable.rb:14:in ` __send__' from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/network/ retrievable.rb:14:in`method\_missing’  
from /usr/lib/ruby/gems/1.8/gems/mail-1.5.2/lib/mail/mail.rb:135:in  
`last’  
from (irb):9

my code for reading email is,

Mail.defaults do  
pop3 ‘’ do  
user ‘’  
pass ‘’  
#enable\_tls  
end  
end

Is it I missed something over here?
