authenticate

authenticate(auth_type, *args)
Instance Public methods

Sends an AUTHENTICATE command to authenticate the client. The auth_type parameter is a string that represents the authentication mechanism to be used. Currently Net::IMAP supports authentication mechanisms:

LOGIN:: login using cleartext user and password.
CRAM-MD5:: login with cleartext user and encrypted password
           (see [RFC-2195] for a full description).  This
           mechanism requires that the server have the user's
           password stored in clear-text password.

For both these mechanisms, there should be two args: username and (cleartext) password. A server may not support one or other of these mechanisms; check capability() for a capability of the form âAUTH=LOGINâ or âAUTH=CRAM-MD5â.

Authentication is done using the appropriate authenticator object: see @@authenticators for more information on plugging in your own authenticator.

For example:

imap.authenticate('LOGIN', user, password)

A Net::IMAP::NoResponseError is raised if authentication fails.

doc_ruby_on_rails
2015-04-22 00:21:38
Comments
Leave a Comment

Please login to continue.