confusing tlsmail error Bad login (Net::POPAuthenticationError)

D

David Burns

I am trying to execute an example listed on
http://rubydoc.info/gems/tlsmail/0.0.1/frames.

example code begins with:
#require 'net/pop'

#pop = Net::pOP3.new('pop.example.com')
#pop.start('YourAccount', 'YourPassword') # (1)
[etc. elided ...]

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.

Anyone have a clue for me?
mahalo,
Dave
 
B

Brian Candler

David Burns wrote in post #981887:
/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.
 
D

David Burns

Oops, never mind. I was having a problem earlier with the password, so
I changed it, but did not update the test code. DOH!

Thanks to Brian Candler for clarifying.

I am trying to execute an example listed on
http://rubydoc.info/gems/tlsmail/0.0.1/frames.


Anyone have a clue for me?
mahalo,
Dave
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top