1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

{protocol,smtp,pop,http}.rb for ruby 1.4 branch

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2000-04-18 09:39:41 +00:00
parent cf520dda16
commit 54588fb3f1
3 changed files with 82 additions and 72 deletions

View file

@ -74,6 +74,14 @@ Net::Protocol
protocol_param :command_type, '::Net::SMTPCommand'
def initialize( addr = nil, port = nil )
super
@esmtp = true
end
attr :esmtp
def sendmail( mailsrc, fromaddr, toaddrs )
do_ready fromaddr, toaddrs
@command.write_mail mailsrc, nil
@ -85,9 +93,6 @@ Net::Protocol
end
attr :esmtp
private
@ -104,10 +109,18 @@ Net::Protocol
@esmtp = false
begin
@command.ehlo helodom
@esmtp = true
if @esmtp then
@command.ehlo helodom
else
@command.helo helodom
end
rescue ProtocolError
@command.helo helodom
if @esmtp then
@esmtp = false
retry
else
raise
end
end
end