Hi all,
Does anybody have any ideea how can I use POP3 with ssl
from Ruby? I googled all I could and all I found was this
solution, which is quite outdated, as it references 'ssl'
while now the library its being called 'openssl'.
==== pop3s.rb ==========================
require 'net/pop'
require 'openssl'
module Net
class POP3S < POP3
def POP3S.default_port
995
end
def POP3S.socket_type
Net::SSLSocket
end
def on_connect
@socket.ssl_connect
end
end
end
==== end ===============================
However this won't work:
# irb
irb(main):001:0> require 'pops.rb'
=> true
irb(main):002:0> pop = Net::POP3S.new 'localhost'
=> #<Net::POP3S localhost:995 open=false>
irb(main):003:0> pop.start('x','y')
NameError: uninitialized constant Net::SSLSocket
from ./pops.rb:16:in `socket_type'
from /usr/local/lib/ruby/1.8/net/pop.rb:438:in `do_start'
from /usr/local/lib/ruby/1.8/net/pop.rb:432:in `start'
from (irb):3
from /usr/local/lib/ruby/1.8/openssl/digest.rb:37
If I replace Net::SSLSocket with OpenSSL::SSL::SSLSocket
I get an error about 'old_connect undefined' instead...
Any tips/help are greatly appreaciated,
Thank you,
Alex