From 254046878a65adefdf73eb0f2c55c3d006985b2c Mon Sep 17 00:00:00 2001 From: aamine Date: Sat, 24 May 2003 18:30:05 +0000 Subject: [PATCH] * lib/net/smtp.rb: support LOGIN authentication. Thanks to Kazuhiko Izawa. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@3864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/net/smtp.rb | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0cc3e32404..bd052738af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun May 25 03:33:53 2003 Minero Aoki + + * lib/net/smtp.rb: support LOGIN authentication. Thanks to + Kazuhiko Izawa. + Tue May 20 00:45:40 2003 Yukihiro Matsumoto * dir.c (push_braces): do not push_braces() unless rbrace is found. diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index 12a889c47d..7ca50c67fd 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -324,7 +324,6 @@ module Net } end - # "PLAIN" authentication [RFC2554] def auth_plain( user, secret ) atomic { getok sprintf('AUTH PLAIN %s', @@ -332,7 +331,14 @@ module Net } end - # "CRAM-MD5" authentication [RFC2195] + def auth_login(user, secret) + atomic{ + getok("AUTH LOGIN", ContinueCode) + getok([user].pack('m').chomp, ContinueCode) + getok([secret].pack('m').chomp) + } + end + def auth_cram_md5( user, secret ) atomic { rep = getok( 'AUTH CRAM-MD5', ContinueCode )