summaryrefslogtreecommitdiff
path: root/lib/net/smtp.rb
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-04-18 09:39:02 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-04-18 09:39:02 +0000
commit4f0aeb3cf739b246bfae2ac8a789e1f57c582abc (patch)
tree357c1aef0bf57364c00c910343ed0d9fad04a4f4 /lib/net/smtp.rb
parentc8f58f2a16c88603abe56c34b346cad5817975b3 (diff)
{protocol,smtp,pop}.rb version 1.1.14
o http.rb: HTTP#head2 o http.rb: HTTPResponse#value o http.rb: get2/post2 returns response header o http.rb: *2 does not raise exceptions o smtp.rb: try esmtp only first time o protocol.rb: remove error_occured o protocol.rb: Command#error! does not take argument git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/smtp.rb')
-rw-r--r--lib/net/smtp.rb25
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index e6b4832..2714412 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -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