summaryrefslogtreecommitdiff
path: root/lib/net/smtp.rb
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-03-27 15:52:27 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-03-27 15:52:27 +0000
commit9fd5174ef3aebe3d862289b4c646e65b2400b2f9 (patch)
tree36ba0828cb3b1f2bb70a53e7661a6e9ca7162f78 /lib/net/smtp.rb
parent0dcf7498b10c7fd4739b34236502efd8e0f8353c (diff)
v1.1.11
o all: use "critical" to avoid duplicated command dispatch o http.rb: change get2, post2 usage (HTTPWriter) o http.rb: entity reading algorithm is better o http.rb: more reply code (4xx, 5xx) o protocol.rb: arguments of "connect" can be omitted o protocol.rb: "quit" is not template method (now do_quit is removed) o protocol.rb: ReplyCode.error_type was not work: using module_eval git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/smtp.rb')
-rw-r--r--lib/net/smtp.rb32
1 files changed, 23 insertions, 9 deletions
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index b2ac287..a1a2f53 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -121,33 +121,44 @@ Net::Protocol
def initialize( sock )
super
- check_reply SuccessCode
+ critical {
+ check_reply SuccessCode
+ }
end
def helo( fromdom )
- getok sprintf( 'HELO %s', fromdom )
+ critical {
+ getok sprintf( 'HELO %s', fromdom )
+ }
end
def ehlo( fromdom )
- getok sprintf( 'EHLO %s', fromdom )
+ critical {
+ getok sprintf( 'EHLO %s', fromdom )
+ }
end
def mailfrom( fromaddr )
- getok sprintf( 'MAIL FROM:<%s>', fromaddr )
+ critical {
+ getok sprintf( 'MAIL FROM:<%s>', fromaddr )
+ }
end
def rcpt( toaddrs )
toaddrs.each do |i|
- getok sprintf( 'RCPT TO:<%s>', i )
+ critical {
+ getok sprintf( 'RCPT TO:<%s>', i )
+ }
end
end
def data
+ return unless begin_critical
getok 'DATA', ContinueCode
end
@@ -155,16 +166,19 @@ Net::Protocol
def write_mail( mailsrc = nil, &block )
@socket.write_pendstr mailsrc, &block
check_reply SuccessCode
+ end_critical
end
alias sendmail write_mail
- private
+ def quit
+ critical {
+ getok 'QUIT'
+ }
+ end
- def do_quit
- getok 'QUIT'
- end
+ private
def get_reply