diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/net/smtp.rb | 10 |
2 files changed, 13 insertions, 2 deletions
@@ -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 ) |