diff options
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/imap.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 7886c66fdd..0a992844d4 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -3130,6 +3130,22 @@ module Net end add_authenticator "LOGIN", LoginAuthenticator + # Authenticator for the "PLAIN" authentication type. See + # #authenticate(). + class PlainAuthenticator + def process(data) + return "\0#{@user}\0#{@password}" + end + + private + + def initialize(user, password) + @user = user + @password = password + end + end + add_authenticator "PLAIN", PlainAuthenticator + # Authenticator for the "CRAM-MD5" authentication type. See # #authenticate(). class CramMD5Authenticator |