in reply to Re: Re: How to check number of messages using Net::POP3?
in thread How to check number of messages using Net::POP3?

Could you please explain this, for I don't understand it. quit works pretty good if you manually emulate a POP3 client:

$ telnet *host* 110 Trying *host*... Connected to *host*. Escape character is '^]'. +OK *host* POP3 Server (Version 1.006d) ready at <Wed Dec 24 00:29:42 +2003> user *user* +OK please send PASS command pass invalidpass -ERR invalid usercode or password, please try again quit +OK *host* POP3 Server (Version 1.006d) shutdown. Connection closed by foreign host.
--
b10m

Replies are listed 'Best First'.
Re: Re: How to check number of messages using Net::POP3?
by Roger (Parson) on Dec 23, 2003 at 23:37 UTC
    This depends on how the POP3 server is configured though. If the server disconnects after invalid user/password is passed (as indicated by OP), then calling QUIT on a dropped connection is not going to do any good.

      I still have to disagree with you on this. My qpopper daemon, doesn't allow the use of retrying (as used with the previous example).

      # first try, without calling quits $ telnet *host* 110 Trying *host*... Connected to *host*. Escape character is '^]'. +OK Qpopper (version 4.0.5) at *host* starting. <76162.1072222944@*ho +st*> user *user* +OK Password required for *user*. pass invalidpass -ERR [AUTH] Password supplied for "*user*" is incorrect. +OK Pop server at *host* signing off. Connection closed by foreign host. # second try, now calling quit $ telnet *host* 110 Trying *host*... Connected to *host*. Escape character is '^]'. +OK Qpopper (version 4.0.5) at *host* starting. <76181.1072223079@*ho +st*> user *user* +OK Password required for *user*. pass invalidpass -ERR [AUTH] Password supplied for "*user*" is incorrect. quit +OK Pop server at *host* signing off. Connection closed by foreign host.

      The daemon allows some time for a quit command, before dropping the connection. So far I have tested 4 POP3 daemons:

      • Qpopper (version 4.0.5)
      • POP3 Server (Version 1.006d)
      • POP3 v2001.78rh server
      • Other unknown POP3 daemon

      All of the above allow some time before they disconnect (if they do it at all). Unfortunally, POP3 daemons are allowed to drop the connection straight after an invalid password, according to RFC1939:

      "After returning a negative status indicator, the server may close the connection."

      So, I'm affraid the OP is dealt some wrong cards. In general, would it be bad to "quit" a connection, even if there's a bad login? Based on my testing experiences, I tend not to believe that.

      --
      b10m