I copied the complete example to a file, filled in my
server/username/password info, ran it and go this error:
ruby /users/tburns/ruby/getmail.rb
/usr/lib/ruby/1.8/net/pop.rb:864:in check_response_auth': -ERR Bad login (Net::POPAuthenticationError) from /usr/lib/ruby/1.8/net/pop.rb:766:in auth’
from /usr/lib/ruby/1.8/net/pop.rb:445:in do_start' from /usr/lib/ruby/1.8/net/pop.rb:432:in start’
from /users/tburns/ruby/getmail.rb:4
Apparently it bombs when executing the start method.
I am able to download email from that account with the same
username/password in thunderbird, without special ports or anything. I
am not strong in ruby yet, and I have no idea how to troubleshoot
this. I googled `check_response_auth’: -ERR Bad login
(Net::POPAuthenticationError), got few hits, none helpful.
Could it be an SSL thing? I think the server is happy with or without
ssl.
/usr/lib/ruby/1.8/net/pop.rb:864:in `check_response_auth’: -ERR Bad
login (Net::POPAuthenticationError)
“-ERR Bad login” is the actual response from the POP3 server. It means
you gave a bad username or password.
I am able to download email from that account with the same
username/password in thunderbird, without special ports or anything.
First try using telnet:
telnet pop.example.com 110
CAPA
USER username
PASS password
QUIT
If you get +OK then you logged in successfully. If you get -ERR then the
username and/or password is incorrect.
If you get -ERR then paste the transcript to the mailing list, blanking
out the password you tried, and we may be able to determine more from
what’s seen.
Could it be an SSL thing?
No. You would not be able to see -ERR in that case.
In case anyone cares, here is how I debugged… The run bombs during
check_response_auth, defined as:
def check_response_auth(res)
raise POPAuthenticationError, res unless /\A+OK/i === res
res
end
I changed that to debug as follows: #grep -A5 ‘def check_response_auth’ /usr/lib/ruby/1.8/net/pop.rb
def check_response_auth( res )
puts res
raise POPAuthenticationError, res unless /\A+OK/i === res
res
end
AFter that, the run looks like:
ruby ruby/getmail.rb
+OK User name accepted, password please
-ERR Bad login
/usr/lib/ruby/1.8/net/pop.rb:865:in check_response_auth': -ERR Bad login (Net::POPAuthenticationError) from /usr/lib/ruby/1.8/net/pop.rb:766:in auth’
from /usr/lib/ruby/1.8/net/pop.rb:445:in do_start' from /usr/lib/ruby/1.8/net/pop.rb:432:in start’
from ruby/getmail.rb:4
So we see the username is accepted, but then the password rejected.
Dave
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.