0

I’m trying to write a Ruby script that goes through an IMAP server, and I have set this up as test case. For some reason, though, I can’t get it to actually find the port. I’ve even tried running getaddrinfo, with no luck. It simply won’t acknowledge the server’s existence.

require 'net/imap'

test = File.new "test.txt", 'w'

imap = Net::IMAP.new('imap.google.com', 993, usessl=true, certs=nil, verify=false)
imap.authenticate('LOGIN', 'user', 'pass')
imap.examine('Mail')

imap.search(["SMS"]).each do |msg|
    test << msg
end
4

1 回答 1

0

服务器是 imap.gmail.com 或 imap.googlemail.com

于 2013-09-05T23:31:52.577 回答