Skip to content

Commit 2540468

Browse files
author
aamine
committed
* 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
1 parent 68eaa28 commit 2540468

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Sun May 25 03:33:53 2003 Minero Aoki <aamine@loveruby.net>
2+
3+
* lib/net/smtp.rb: support LOGIN authentication. Thanks to
4+
Kazuhiko Izawa.
5+
16
Tue May 20 00:45:40 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
27

38
* dir.c (push_braces): do not push_braces() unless rbrace is found.

lib/net/smtp.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,21 @@ def ehlo( domain )
324324
}
325325
end
326326

327-
# "PLAIN" authentication [RFC2554]
328327
def auth_plain( user, secret )
329328
atomic {
330329
getok sprintf('AUTH PLAIN %s',
331330
["\0#{user}\0#{secret}"].pack('m').chomp)
332331
}
333332
end
334333

335-
# "CRAM-MD5" authentication [RFC2195]
334+
def auth_login(user, secret)
335+
atomic{
336+
getok("AUTH LOGIN", ContinueCode)
337+
getok([user].pack('m').chomp, ContinueCode)
338+
getok([secret].pack('m').chomp)
339+
}
340+
end
341+
336342
def auth_cram_md5( user, secret )
337343
atomic {
338344
rep = getok( 'AUTH CRAM-MD5', ContinueCode )

0 commit comments

Comments
 (0)