summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-24 18:30:05 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-24 18:30:05 +0000
commit254046878a65adefdf73eb0f2c55c3d006985b2c (patch)
treef9211bab5794d4c25fd53011a8e1a900c2459df4
parent68eaa2864ea57c48444eb22123e57369715cb25d (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/smtp.rb10
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 <aamine@loveruby.net>
+
+ * lib/net/smtp.rb: support LOGIN authentication. Thanks to
+ Kazuhiko Izawa.
+
Tue May 20 00:45:40 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* 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 )