2003-08-05 09:22:20 -04:00
|
|
|
# = net/pop.rb
|
|
|
|
#
|
|
|
|
#--
|
|
|
|
# Copyright (c) 1999-2003 Yukihiro Matsumoto
|
|
|
|
# Copyright (c) 1999-2003 Minero Aoki
|
|
|
|
#
|
|
|
|
# written & maintained by Minero Aoki <aamine@loveruby.net>
|
|
|
|
#
|
|
|
|
# This program is free software. You can re-distribute and/or
|
|
|
|
# modify this program under the same terms as Ruby itself,
|
|
|
|
# Ruby Distribute License or GNU General Public License.
|
|
|
|
#
|
|
|
|
# NOTE: You can find Japanese version of this document in
|
|
|
|
# the doc/net directory of the standard ruby interpreter package.
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#++
|
|
|
|
#
|
|
|
|
# == What is This Library?
|
|
|
|
#
|
|
|
|
# This library provides functionality for retrieving
|
|
|
|
# email via POP3, the Post Office Protocol version 3. For details
|
|
|
|
# of POP3, see [RFC1939] (http://www.ietf.org/rfc/rfc1939.txt).
|
|
|
|
#
|
|
|
|
# == Examples
|
|
|
|
#
|
|
|
|
# === Retrieving Messages
|
|
|
|
#
|
|
|
|
# This example retrieves messages from the server and deletes them
|
|
|
|
# on the server.
|
|
|
|
# Messages are written to files named 'inbox/1', 'inbox/2', ....
|
|
|
|
# Replace 'pop.example.com' with your POP3 server address, and
|
|
|
|
# 'YourAccount' and 'YourPassword' with the appropriate account
|
|
|
|
# details.
|
|
|
|
#
|
|
|
|
# require 'net/pop'
|
|
|
|
#
|
|
|
|
# pop = Net::POP3.new('pop.example.com')
|
|
|
|
# pop.start('YourAccount', 'YourPassword') # (1)
|
|
|
|
# if pop.mails.empty?
|
|
|
|
# puts 'no mail.'
|
|
|
|
# else
|
|
|
|
# i = 0
|
|
|
|
# pop.each_mail do |m| # or "pop.mails.each ..." # (2)
|
|
|
|
# File.open("inbox/#{i}", 'w') {|f|
|
|
|
|
# f.write m.pop
|
|
|
|
# }
|
|
|
|
# m.delete
|
|
|
|
# i += 1
|
|
|
|
# end
|
|
|
|
# puts "#{pop.mails.size} mails popped."
|
|
|
|
# end
|
|
|
|
# pop.finish # (3)
|
|
|
|
#
|
|
|
|
# 1. call Net::POP3#start and start POP session
|
|
|
|
# 2. access messages by using POP3#each_mail and/or POP3#mails
|
|
|
|
# 3. close POP session by calling POP3#finish or use the block form of #start.
|
|
|
|
#
|
|
|
|
# === Shortened Code
|
|
|
|
#
|
|
|
|
# The example above is very verbose. You can shorten the code by using
|
|
|
|
# some utility methods. First, the block form of Net::POP3.start can
|
|
|
|
# be used instead of POP3.new, POP3#start and POP3#finish.
|
|
|
|
#
|
|
|
|
# require 'net/pop'
|
|
|
|
#
|
|
|
|
# Net::POP3.start('pop.example.com', 110,
|
|
|
|
# 'YourAccount', 'YourPassword') {|pop|
|
|
|
|
# if pop.mails.empty?
|
|
|
|
# puts 'no mail.'
|
|
|
|
# else
|
|
|
|
# i = 0
|
|
|
|
# pop.each_mail do |m| # or "pop.mails.each ..."
|
|
|
|
# File.open("inbox/#{i}", 'w') {|f|
|
|
|
|
# f.write m.pop
|
|
|
|
# }
|
|
|
|
# m.delete
|
|
|
|
# i += 1
|
|
|
|
# end
|
|
|
|
# puts "#{pop.mails.size} mails popped."
|
|
|
|
# end
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# POP3#delete_all alternates #each_mail and m.delete.
|
|
|
|
#
|
|
|
|
# require 'net/pop'
|
|
|
|
#
|
|
|
|
# Net::POP3.start('pop.example.com', 110,
|
|
|
|
# 'YourAccount', 'YourPassword') {|pop|
|
|
|
|
# if pop.mails.empty?
|
|
|
|
# puts 'no mail.'
|
|
|
|
# else
|
|
|
|
# i = 1
|
|
|
|
# pop.delete_all do |m|
|
|
|
|
# File.open("inbox/#{i}", 'w') {|f|
|
|
|
|
# f.write m.pop
|
|
|
|
# }
|
|
|
|
# i += 1
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# And here is an even shorter example.
|
|
|
|
#
|
|
|
|
# require 'net/pop'
|
|
|
|
#
|
|
|
|
# i = 0
|
|
|
|
# Net::POP3.delete_all('pop.example.com', 110,
|
|
|
|
# 'YourAccount', 'YourPassword') do |m|
|
|
|
|
# File.open("inbox/#{i}", 'w') {|f|
|
|
|
|
# f.write m.pop
|
|
|
|
# }
|
|
|
|
# i += 1
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# === Memory Space Issues
|
|
|
|
#
|
|
|
|
# All the examples above get each message as one big string.
|
|
|
|
# This example avoids this.
|
|
|
|
#
|
|
|
|
# require 'net/pop'
|
|
|
|
#
|
|
|
|
# i = 1
|
|
|
|
# Net::POP3.delete_all('pop.example.com', 110,
|
|
|
|
# 'YourAccount', 'YourPassword') do |m|
|
|
|
|
# File.open("inbox/#{i}", 'w') {|f|
|
|
|
|
# m.pop do |chunk| # get a message little by little.
|
|
|
|
# f.write chunk
|
|
|
|
# end
|
|
|
|
# i += 1
|
|
|
|
# }
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# === Using APOP
|
|
|
|
#
|
|
|
|
# The net/pop library supports APOP authentication.
|
|
|
|
# To use APOP, use the Net::APOP class instead of the Net::POP3 class.
|
|
|
|
# You can use the utility method, Net::POP3.APOP(). For example:
|
|
|
|
#
|
|
|
|
# require 'net/pop'
|
|
|
|
#
|
|
|
|
# # Use APOP authentication if $isapop == true
|
|
|
|
# pop = Net::POP3.APOP($is_apop).new('apop.example.com', 110)
|
|
|
|
# pop.start(YourAccount', 'YourPassword') {|pop|
|
|
|
|
# # Rest code is same.
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# === Fetch Only Selected Mail Using `UIDL' POP Command
|
|
|
|
#
|
|
|
|
# If your POP server provides UIDL functionality,
|
|
|
|
# you can grab only selected mails from the POP server.
|
|
|
|
# e.g.
|
|
|
|
#
|
|
|
|
# def need_pop?( id )
|
|
|
|
# # determine if we need pop this mail...
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# Net::POP3.start('pop.example.com', 110,
|
|
|
|
# 'Your account', 'Your password') {|pop|
|
|
|
|
# pop.mails.select {|m| need_pop?(m.unique_id) }.each do |m|
|
|
|
|
# do_something(m.pop)
|
|
|
|
# end
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# The POPMail#unique_id() method returns the unique-id of the message as a
|
|
|
|
# String. Normally the unique-id is a hash of the message.
|
|
|
|
#
|
2003-08-05 12:12:05 -04:00
|
|
|
|
2000-06-12 12:42:46 -04:00
|
|
|
require 'net/protocol'
|
2001-12-01 09:07:01 -05:00
|
|
|
require 'digest/md5'
|
2000-06-12 12:42:46 -04:00
|
|
|
|
|
|
|
module Net
|
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
# Non-authentication POP3 protocol error
|
|
|
|
# (reply code "-ERR", except authentication).
|
2003-05-02 10:35:01 -04:00
|
|
|
class POPError < ProtocolError; end
|
2003-08-05 09:22:20 -04:00
|
|
|
|
|
|
|
# POP3 authentication error.
|
2003-05-02 10:35:01 -04:00
|
|
|
class POPAuthenticationError < ProtoAuthError; end
|
2003-08-05 09:22:20 -04:00
|
|
|
|
|
|
|
# Unexpected response from the server.
|
2003-07-01 22:34:39 -04:00
|
|
|
class POPBadResponse < POPError; end
|
2003-05-02 10:35:01 -04:00
|
|
|
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
#
|
|
|
|
# Class providing POP3 client functionality.
|
|
|
|
#
|
|
|
|
# See documentation for the file pop.rb for examples of usage.
|
|
|
|
#
|
2003-05-02 11:19:20 -04:00
|
|
|
class POP3 < Protocol
|
2003-05-02 10:35:01 -04:00
|
|
|
|
|
|
|
Revision = %q$Revision$.split[1]
|
2003-03-09 11:53:30 -05:00
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
#
|
|
|
|
# Class Parameters
|
|
|
|
#
|
2003-03-09 11:53:30 -05:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# The default port for POP3 connections, port 110
|
2003-05-02 10:35:01 -04:00
|
|
|
def POP3.default_port
|
|
|
|
110
|
|
|
|
end
|
2000-06-12 12:42:46 -04:00
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
def POP3.socket_type #:nodoc: obsolete
|
2003-05-02 10:35:01 -04:00
|
|
|
Net::InternetMessageIO
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Utilities
|
|
|
|
#
|
2000-06-12 12:42:46 -04:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Returns the APOP class if +isapop+ is true; otherwise, returns
|
|
|
|
# the POP class. For example:
|
|
|
|
#
|
|
|
|
# # Example 1
|
|
|
|
# pop = Net::POP3::APOP($is_apop).new(addr, port)
|
|
|
|
#
|
|
|
|
# # Example 2
|
|
|
|
# Net::POP3::APOP($is_apop).start(addr, port) {|pop|
|
|
|
|
# ....
|
|
|
|
# }
|
2003-08-05 12:12:05 -04:00
|
|
|
#
|
2002-11-21 06:50:09 -05:00
|
|
|
def POP3.APOP( isapop )
|
|
|
|
isapop ? APOP : POP3
|
2002-02-19 07:33:52 -05:00
|
|
|
end
|
2001-12-13 14:15:21 -05:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Starts a POP3 session and iterates over each POPMail object,
|
|
|
|
# yielding it to the +block+.
|
|
|
|
# This method is equivalent to:
|
|
|
|
#
|
|
|
|
# Net::POP3.start(address, port, account, password) {|pop|
|
|
|
|
# pop.each_mail do |m|
|
|
|
|
# yield m
|
|
|
|
# end
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# This method raises a POPAuthenticationError if authentication fails.
|
|
|
|
#
|
|
|
|
# # Typical usage
|
|
|
|
# Net::POP3.foreach('pop.example.com', 110,
|
|
|
|
# 'YourAccount', 'YourPassword') do |m|
|
|
|
|
# file.write m.pop
|
|
|
|
# m.delete if $DELETE
|
|
|
|
# end
|
2003-08-05 12:12:05 -04:00
|
|
|
#
|
2002-02-19 07:33:52 -05:00
|
|
|
def POP3.foreach( address, port = nil,
|
2003-05-02 10:35:01 -04:00
|
|
|
account = nil, password = nil,
|
2003-08-05 09:22:20 -04:00
|
|
|
isapop = false, &block ) # :yields: message
|
2003-05-02 10:35:01 -04:00
|
|
|
start(address, port, account, password, isapop) {|pop|
|
2003-07-01 22:34:39 -04:00
|
|
|
pop.each_mail(&block)
|
2002-02-19 07:33:52 -05:00
|
|
|
}
|
|
|
|
end
|
2000-12-22 13:40:55 -05:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Starts a POP3 session and deletes all messages on the server.
|
|
|
|
# If a block is given, each POPMail object is yielded to it before
|
|
|
|
# being deleted.
|
|
|
|
#
|
|
|
|
# This method raises a POPAuthenticationError if authentication fails.
|
|
|
|
#
|
|
|
|
# # Example
|
|
|
|
# Net::POP3.delete_all('pop.example.com', 110,
|
|
|
|
# 'YourAccount', 'YourPassword') do |m|
|
|
|
|
# file.write m.pop
|
|
|
|
# end
|
2003-08-05 12:12:05 -04:00
|
|
|
#
|
2002-02-19 07:33:52 -05:00
|
|
|
def POP3.delete_all( address, port = nil,
|
2003-05-02 10:35:01 -04:00
|
|
|
account = nil, password = nil,
|
|
|
|
isapop = false, &block )
|
|
|
|
start(address, port, account, password, isapop) {|pop|
|
2003-07-01 22:34:39 -04:00
|
|
|
pop.delete_all(&block)
|
2002-02-19 07:33:52 -05:00
|
|
|
}
|
|
|
|
end
|
2001-06-26 19:49:21 -04:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Opens a POP3 session, attempts authentication, and quits.
|
|
|
|
#
|
|
|
|
# This method raises POPAuthenticationError if authentication fails.
|
|
|
|
#
|
|
|
|
# # Example 1: normal POP3
|
|
|
|
# Net::POP3.auth_only('pop.example.com', 110,
|
|
|
|
# 'YourAccount', 'YourPassword')
|
|
|
|
#
|
|
|
|
# # Example 2: APOP
|
|
|
|
# Net::POP3.auth_only('pop.example.com', 110,
|
|
|
|
# 'YourAccount', 'YourPassword', true)
|
2003-08-05 12:12:05 -04:00
|
|
|
#
|
2002-02-19 07:33:52 -05:00
|
|
|
def POP3.auth_only( address, port = nil,
|
2003-05-02 10:35:01 -04:00
|
|
|
account = nil, password = nil,
|
|
|
|
isapop = false )
|
|
|
|
new(address, port, isapop).auth_only account, password
|
2000-12-22 13:40:55 -05:00
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Starts a pop3 session, attempts authentication, and quits.
|
|
|
|
# This method must not be called while POP3 session is opened.
|
|
|
|
# This method raises POPAuthenticationError if authentication fails.
|
2001-12-30 14:18:45 -05:00
|
|
|
def auth_only( account, password )
|
2003-05-04 02:04:03 -04:00
|
|
|
raise IOError, 'opening already opened POP session' if started?
|
2002-11-21 06:50:09 -05:00
|
|
|
start(account, password) {
|
2003-07-01 22:34:39 -04:00
|
|
|
;
|
2001-12-30 14:18:45 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
2003-05-02 10:35:01 -04:00
|
|
|
# Session management
|
2001-12-30 14:18:45 -05:00
|
|
|
#
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Creates a new POP3 object and open the connection. Equivalent to
|
|
|
|
# Net::POP3.new(address, port, isapop).start(account, password)
|
|
|
|
#
|
|
|
|
# If +block+ is provided, yields the newly-opened POP3 object to it,
|
|
|
|
# and automatically closes it at the end of the session.
|
|
|
|
#
|
|
|
|
# Typical usage:
|
|
|
|
#
|
|
|
|
# Net::POP3.start(addr, port, account, password) {|pop|
|
|
|
|
# pop.each_mail do |m|
|
|
|
|
# file.write m.pop
|
|
|
|
# m.delete
|
|
|
|
# end
|
|
|
|
# }
|
|
|
|
#
|
2003-05-02 10:35:01 -04:00
|
|
|
def POP3.start( address, port = nil,
|
|
|
|
account = nil, password = nil,
|
2003-08-05 09:22:20 -04:00
|
|
|
isapop = false, &block ) # :yield: pop
|
2003-05-02 10:35:01 -04:00
|
|
|
new(address, port, isapop).start(account, password, &block)
|
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Creates a new POP3 object.
|
|
|
|
# +address+ is the hostname or ip address of your POP3 server.
|
|
|
|
# The optional +port+ is the port to connect to; it defaults to 110.
|
|
|
|
# The optional +isapop+ specifies whether this connection is going
|
|
|
|
# to use APOP authentication; it defaults to +false+.
|
|
|
|
# This method does *not* open the TCP connection.
|
2003-05-02 10:35:01 -04:00
|
|
|
def initialize( addr, port = nil, isapop = false )
|
|
|
|
@address = addr
|
|
|
|
@port = port || self.class.default_port
|
|
|
|
@apop = isapop
|
|
|
|
|
|
|
|
@command = nil
|
|
|
|
@socket = nil
|
|
|
|
@started = false
|
|
|
|
@open_timeout = 30
|
|
|
|
@read_timeout = 60
|
|
|
|
@debug_output = nil
|
|
|
|
|
2000-10-12 05:54:32 -04:00
|
|
|
@mails = nil
|
2003-05-06 04:48:51 -04:00
|
|
|
@n_mails = nil
|
|
|
|
@n_bytes = nil
|
2000-06-12 12:42:46 -04:00
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Does this instance use APOP authentication?
|
2003-05-02 10:35:01 -04:00
|
|
|
def apop?
|
|
|
|
@apop
|
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Provide human-readable stringification of class state.
|
2003-05-02 10:35:01 -04:00
|
|
|
def inspect
|
|
|
|
"#<#{self.class} #{@address}:#{@port} open=#{@started}>"
|
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# *WARNING*: This method causes a serious security hole.
|
|
|
|
# Use this method only for debugging.
|
|
|
|
#
|
|
|
|
# Set an output stream for debugging.
|
|
|
|
#
|
|
|
|
# # Example
|
|
|
|
# pop = Net::POP.new(addr, port)
|
|
|
|
# pop.set_debug_output $stderr
|
|
|
|
# pop.start(account, passwd) {
|
|
|
|
# ....
|
|
|
|
# }
|
2003-08-05 12:12:05 -04:00
|
|
|
#
|
2003-07-01 22:34:39 -04:00
|
|
|
def set_debug_output( arg )
|
2003-05-02 10:35:01 -04:00
|
|
|
@debug_output = arg
|
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# The address to connect to.
|
2003-05-02 10:35:01 -04:00
|
|
|
attr_reader :address
|
2003-08-05 09:22:20 -04:00
|
|
|
|
|
|
|
# The port number to connect to.
|
2003-05-02 10:35:01 -04:00
|
|
|
attr_reader :port
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Seconds to wait until a connection is opened.
|
|
|
|
# If the POP3 object cannot open a connection within this time,
|
|
|
|
# it raises a TimeoutError exception.
|
2003-05-02 10:35:01 -04:00
|
|
|
attr_accessor :open_timeout
|
2003-08-05 09:22:20 -04:00
|
|
|
|
|
|
|
# Seconds to wait until reading one block (by one read(1) call).
|
|
|
|
# If the POP3 object cannot complete a read() within this time,
|
|
|
|
# it raises a TimeoutError exception.
|
2003-05-02 10:35:01 -04:00
|
|
|
attr_reader :read_timeout
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Set the read timeout.
|
2003-05-02 10:35:01 -04:00
|
|
|
def read_timeout=( sec )
|
|
|
|
@command.socket.read_timeout = sec if @command
|
|
|
|
@read_timeout = sec
|
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# +true+ if the POP3 session has started.
|
2003-05-02 10:35:01 -04:00
|
|
|
def started?
|
|
|
|
@started
|
|
|
|
end
|
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
alias active? started? #:nodoc: obsolete
|
2003-05-02 10:35:01 -04:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Starts a POP3 session.
|
|
|
|
#
|
|
|
|
# When called with block, gives a POP3 object to the block and
|
|
|
|
# closes the session after block call finishes.
|
|
|
|
#
|
|
|
|
# This method raises a POPAuthenticationError if authentication fails.
|
|
|
|
def start( account, password ) # :yield: pop
|
2003-05-04 02:04:03 -04:00
|
|
|
raise IOError, 'POP session already started' if @started
|
2003-05-02 10:35:01 -04:00
|
|
|
|
|
|
|
if block_given?
|
|
|
|
begin
|
|
|
|
do_start account, password
|
|
|
|
return yield(self)
|
|
|
|
ensure
|
2003-09-29 14:12:20 -04:00
|
|
|
do_finish
|
2003-05-02 10:35:01 -04:00
|
|
|
end
|
|
|
|
else
|
2003-07-01 12:34:58 -04:00
|
|
|
do_start account, password
|
2003-05-02 10:35:01 -04:00
|
|
|
return self
|
|
|
|
end
|
|
|
|
end
|
2001-12-30 14:18:45 -05:00
|
|
|
|
|
|
|
def do_start( account, password )
|
2003-05-02 10:35:01 -04:00
|
|
|
@socket = self.class.socket_type.open(@address, @port,
|
|
|
|
@open_timeout, @read_timeout, @debug_output)
|
|
|
|
on_connect
|
|
|
|
@command = POP3Command.new(@socket)
|
|
|
|
if apop?
|
|
|
|
@command.apop account, password
|
|
|
|
else
|
|
|
|
@command.auth account, password
|
|
|
|
end
|
|
|
|
@started = true
|
2003-09-29 14:12:20 -04:00
|
|
|
ensure
|
|
|
|
do_finish if not @started
|
2001-12-30 14:18:45 -05:00
|
|
|
end
|
2003-05-02 10:35:01 -04:00
|
|
|
private :do_start
|
2001-12-30 14:18:45 -05:00
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
def on_connect
|
2002-11-21 06:50:09 -05:00
|
|
|
end
|
2003-05-02 10:35:01 -04:00
|
|
|
private :on_connect
|
2002-11-21 06:50:09 -05:00
|
|
|
|
2003-09-29 10:39:54 -04:00
|
|
|
# Finishes a POP3 session and closes TCP connection.
|
2003-05-02 10:35:01 -04:00
|
|
|
def finish
|
2003-09-29 14:12:20 -04:00
|
|
|
raise IOError, 'POP session not started yet' unless started?
|
|
|
|
do_finish
|
|
|
|
end
|
|
|
|
|
|
|
|
def do_finish
|
2001-12-30 14:18:45 -05:00
|
|
|
@mails = nil
|
2003-05-02 10:35:01 -04:00
|
|
|
@command.quit if @command
|
2003-09-29 14:12:20 -04:00
|
|
|
ensure
|
|
|
|
@started = false
|
2003-05-02 10:35:01 -04:00
|
|
|
@command = nil
|
|
|
|
@socket.close if @socket and not @socket.closed?
|
|
|
|
@socket = nil
|
2001-06-26 19:49:21 -04:00
|
|
|
end
|
2003-09-29 14:12:20 -04:00
|
|
|
private :do_finish
|
2001-06-26 19:49:21 -04:00
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
def command
|
|
|
|
raise IOError, 'POP session not opened yet' \
|
|
|
|
if not @socket or @socket.closed?
|
|
|
|
@command
|
|
|
|
end
|
|
|
|
private :command
|
|
|
|
|
2001-12-30 14:18:45 -05:00
|
|
|
#
|
2003-05-02 10:35:01 -04:00
|
|
|
# POP protocol wrapper
|
2001-12-30 14:18:45 -05:00
|
|
|
#
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Returns the number of messages on the POP server.
|
2003-05-06 04:48:51 -04:00
|
|
|
def n_mails
|
|
|
|
return @n_mails if @n_mails
|
|
|
|
@n_mails, @n_bytes = command().stat
|
|
|
|
@n_mails
|
2003-03-09 11:53:30 -05:00
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Returns the total size in bytes of all the messages on the POP server.
|
2003-05-06 04:48:51 -04:00
|
|
|
def n_bytes
|
|
|
|
return @n_bytes if @n_bytes
|
|
|
|
@n_mails, @n_bytes = command().stat
|
|
|
|
@n_bytes
|
2003-03-09 11:53:30 -05:00
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Returns an array of Net::POPMail objects, representing all the
|
|
|
|
# messages on the server. This array is renewed when the session
|
|
|
|
# restarts; otherwise, it is fetched from the server the first time
|
|
|
|
# this method is called (directly or indirectly) and cached.
|
|
|
|
#
|
|
|
|
# This method raises a POPError if an error occurs.
|
2001-12-30 14:18:45 -05:00
|
|
|
def mails
|
2003-05-02 10:35:01 -04:00
|
|
|
return @mails.dup if @mails
|
2003-05-06 04:48:51 -04:00
|
|
|
if n_mails() == 0
|
2003-03-09 11:53:30 -05:00
|
|
|
# some popd raises error for LIST on the empty mailbox.
|
|
|
|
@mails = []
|
2003-05-02 10:35:01 -04:00
|
|
|
return []
|
2003-03-09 11:53:30 -05:00
|
|
|
end
|
2001-12-30 14:18:45 -05:00
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
@mails = command().list.map {|num, size|
|
2003-07-01 22:34:39 -04:00
|
|
|
POPMail.new(num, size, self, command())
|
2003-05-02 10:35:01 -04:00
|
|
|
}
|
|
|
|
@mails.dup
|
2001-12-30 14:18:45 -05:00
|
|
|
end
|
2000-06-12 12:42:46 -04:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Yields each message to the passed-in block in turn.
|
|
|
|
# Equivalent to:
|
|
|
|
#
|
|
|
|
# pop3.mails.each do |popmail|
|
|
|
|
# ....
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# This method raises a POPError if an error occurs.
|
|
|
|
def each_mail( &block ) # :yield: message
|
2002-11-21 06:50:09 -05:00
|
|
|
mails().each(&block)
|
2000-12-22 13:40:55 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
alias each each_mail
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Deletes all messages on the server.
|
|
|
|
#
|
|
|
|
# If called with a block, yields each message in turn before deleting it.
|
|
|
|
#
|
|
|
|
# # Example
|
|
|
|
# n = 1
|
|
|
|
# pop.delete_all do |m|
|
|
|
|
# File.open("inbox/#{n}") {|f|
|
|
|
|
# f.write m.pop
|
|
|
|
# }
|
|
|
|
# n += 1
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# This method raises a POPError if an error occurs.
|
|
|
|
def delete_all # :yield: message
|
2001-12-30 14:18:45 -05:00
|
|
|
mails().each do |m|
|
2000-12-22 13:40:55 -05:00
|
|
|
yield m if block_given?
|
|
|
|
m.delete unless m.deleted?
|
|
|
|
end
|
2000-10-12 05:54:32 -04:00
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Resets the session. This clears all "deleted" marks from messages.
|
|
|
|
#
|
|
|
|
# This method raises a POPError if an error occurs.
|
2000-10-12 05:54:32 -04:00
|
|
|
def reset
|
2001-12-30 14:18:45 -05:00
|
|
|
command().rset
|
|
|
|
mails().each do |m|
|
2003-03-09 11:53:30 -05:00
|
|
|
m.instance_eval {
|
2003-07-01 22:34:39 -04:00
|
|
|
@deleted = false
|
2003-03-09 11:53:30 -05:00
|
|
|
}
|
2000-10-12 05:54:32 -04:00
|
|
|
end
|
2000-06-12 12:42:46 -04:00
|
|
|
end
|
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
def set_all_uids #:nodoc: internal use only (called from POPMail#uidl)
|
2003-05-02 10:35:01 -04:00
|
|
|
command().uidl.each do |num, uid|
|
|
|
|
@mails.find {|m| m.number == num }.uid = uid
|
|
|
|
end
|
2000-10-12 05:54:32 -04:00
|
|
|
end
|
|
|
|
|
2003-07-01 22:34:39 -04:00
|
|
|
end # class POP3
|
2000-06-12 12:42:46 -04:00
|
|
|
|
2003-07-01 22:34:39 -04:00
|
|
|
# class aliases
|
2003-03-09 11:53:30 -05:00
|
|
|
POP = POP3
|
2002-02-19 07:33:52 -05:00
|
|
|
POPSession = POP3
|
|
|
|
POP3Session = POP3
|
2000-06-12 12:42:46 -04:00
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
#
|
2003-08-05 09:22:20 -04:00
|
|
|
# This class is equivalent to POP3, except that it uses APOP authentication.
|
2003-08-05 12:12:05 -04:00
|
|
|
#
|
aamine
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb:
add module Net::NetPrivate and its inner classes
{Read,Write}Adapter, Command, Socket,
SMTPCommand, POP3Command, APOPCommand, HTTPCommand
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-07-12 02:04:40 -04:00
|
|
|
class APOP < POP3
|
2003-08-05 09:22:20 -04:00
|
|
|
# Always returns true.
|
2003-05-02 10:35:01 -04:00
|
|
|
def apop?
|
|
|
|
true
|
2002-02-19 07:33:52 -05:00
|
|
|
end
|
aamine
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb:
add module Net::NetPrivate and its inner classes
{Read,Write}Adapter, Command, Socket,
SMTPCommand, POP3Command, APOPCommand, HTTPCommand
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-07-12 02:04:40 -04:00
|
|
|
end
|
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
# class aliases
|
2002-02-19 07:33:52 -05:00
|
|
|
APOPSession = APOP
|
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
#
|
2003-08-05 09:22:20 -04:00
|
|
|
# This class represents a message which exists on the POP server.
|
|
|
|
# Instances of this class are created by the POP3 class; they should
|
|
|
|
# not be directly created by the user.
|
2003-08-05 12:12:05 -04:00
|
|
|
#
|
1999-12-17 10:00:13 -05:00
|
|
|
class POPMail
|
1999-09-22 03:32:33 -04:00
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
def initialize( num, len, pop, cmd ) #:nodoc:
|
2003-05-02 10:35:01 -04:00
|
|
|
@number = num
|
2003-07-01 22:34:39 -04:00
|
|
|
@length = len
|
2003-05-02 10:35:01 -04:00
|
|
|
@pop = pop
|
1999-12-29 06:14:04 -05:00
|
|
|
@command = cmd
|
1999-12-17 10:00:13 -05:00
|
|
|
@deleted = false
|
2003-05-02 10:35:01 -04:00
|
|
|
@uid = nil
|
1999-12-17 10:00:13 -05:00
|
|
|
end
|
1999-09-22 03:32:33 -04:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# The sequence number of the message on the server.
|
2003-05-02 10:35:01 -04:00
|
|
|
attr_reader :number
|
2003-08-05 09:22:20 -04:00
|
|
|
|
|
|
|
# The length of the message in octets.
|
2003-07-01 22:34:39 -04:00
|
|
|
attr_reader :length
|
|
|
|
alias size length
|
1999-09-22 03:32:33 -04:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Provide human-readable stringification of class state.
|
2000-06-12 12:42:46 -04:00
|
|
|
def inspect
|
2003-05-02 10:35:01 -04:00
|
|
|
"#<#{self.class} #{@number}#{@deleted ? ' deleted' : ''}>"
|
2000-06-12 12:42:46 -04:00
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# This method fetches the message. If called with a block, the
|
|
|
|
# message is yielded to the block one chunk at a time. If called
|
|
|
|
# without a block, the message is returned as a String. The optional
|
|
|
|
# +dest+ argument will be prepended to the returned String; this
|
|
|
|
# argument is essentially obsolete.
|
|
|
|
#
|
|
|
|
# # Example without block
|
|
|
|
# POP3.start('pop.example.com', 110,
|
|
|
|
# 'YourAccount, 'YourPassword') {|pop|
|
|
|
|
# n = 1
|
|
|
|
# pop.mails.each do |popmail|
|
|
|
|
# File.open("inbox/#{n}", 'w') {|f|
|
|
|
|
# f.write popmail.pop
|
|
|
|
# }
|
|
|
|
# popmail.delete
|
|
|
|
# n += 1
|
|
|
|
# end
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# # Example with block
|
|
|
|
# POP3.start('pop.example.com', 110,
|
|
|
|
# 'YourAccount, 'YourPassword') {|pop|
|
|
|
|
# n = 1
|
|
|
|
# pop.mails.each do |popmail|
|
|
|
|
# File.open("inbox/#{n}", 'w') {|f|
|
|
|
|
# popmail.pop do |chunk| ####
|
|
|
|
# f.write chunk
|
|
|
|
# end
|
|
|
|
# }
|
|
|
|
# n += 1
|
|
|
|
# end
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# This method raises a POPError if an error occurs.
|
|
|
|
def pop( dest = '', &block ) # :yield: message_chunk
|
2003-07-01 22:34:39 -04:00
|
|
|
if block_given?
|
|
|
|
@command.retr(@number, &block)
|
|
|
|
nil
|
|
|
|
else
|
|
|
|
@command.retr(@number) do |chunk|
|
|
|
|
dest << chunk
|
|
|
|
end
|
|
|
|
dest
|
|
|
|
end
|
1999-12-17 10:00:13 -05:00
|
|
|
end
|
2001-12-07 05:04:25 -05:00
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
alias all pop #:nodoc: obsolete
|
|
|
|
alias mail pop #:nodoc: obsolete
|
1999-09-22 03:32:33 -04:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Fetches the message header and +lines+ lines of body.
|
|
|
|
# The optional +dest+ argument is obsolete.
|
|
|
|
#
|
|
|
|
# This method raises a POPError if an error occurs.
|
1999-12-17 10:00:13 -05:00
|
|
|
def top( lines, dest = '' )
|
2003-07-01 22:34:39 -04:00
|
|
|
@command.top(@number, lines) do |chunk|
|
|
|
|
dest << chunk
|
|
|
|
end
|
|
|
|
dest
|
1999-12-17 10:00:13 -05:00
|
|
|
end
|
1999-10-18 05:03:16 -04:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Fetches the message header.
|
|
|
|
# The optional +dest+ argument is obsolete.
|
|
|
|
#
|
|
|
|
# This method raises a POPError if an error occurs.
|
1999-12-17 10:00:13 -05:00
|
|
|
def header( dest = '' )
|
2003-05-02 10:35:01 -04:00
|
|
|
top(0, dest)
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Marks a message for deletion on the server. Deletion does not
|
|
|
|
# actually occur until the end of the session; deletion may be
|
|
|
|
# cancelled for _all_ marked messages by calling POP3#reset().
|
|
|
|
#
|
|
|
|
# This method raises a POPError if an error occurs.
|
|
|
|
#
|
|
|
|
# # Example
|
|
|
|
# POP3.start('pop.example.com', 110,
|
|
|
|
# 'YourAccount, 'YourPassword') {|pop|
|
|
|
|
# n = 1
|
|
|
|
# pop.mails.each do |popmail|
|
|
|
|
# File.open("inbox/#{n}", 'w') {|f|
|
|
|
|
# f.write popmail.pop
|
|
|
|
# }
|
|
|
|
# popmail.delete ####
|
|
|
|
# n += 1
|
|
|
|
# end
|
|
|
|
# }
|
2003-08-05 12:12:05 -04:00
|
|
|
#
|
1999-12-17 10:00:13 -05:00
|
|
|
def delete
|
2003-05-02 10:35:01 -04:00
|
|
|
@command.dele @number
|
1999-12-17 10:00:13 -05:00
|
|
|
@deleted = true
|
|
|
|
end
|
2000-10-12 05:54:32 -04:00
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
alias delete! delete #:nodoc: obsolete
|
1999-10-13 03:29:15 -04:00
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# True if the mail has been deleted.
|
1999-12-17 10:00:13 -05:00
|
|
|
def deleted?
|
|
|
|
@deleted
|
|
|
|
end
|
|
|
|
|
2003-08-05 09:22:20 -04:00
|
|
|
# Returns the unique-id of the message.
|
|
|
|
# Normally the unique-id is a hash string of the message.
|
|
|
|
#
|
|
|
|
# This method raises a POPError if an error occurs.
|
2003-05-02 10:35:01 -04:00
|
|
|
def unique_id
|
|
|
|
return @uid if @uid
|
|
|
|
@pop.set_all_uids
|
|
|
|
@uid
|
|
|
|
end
|
|
|
|
|
|
|
|
alias uidl unique_id
|
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
def uid=( uid ) #:nodoc: internal use only (used from POP3#set_all_uids)
|
2003-05-02 10:35:01 -04:00
|
|
|
@uid = uid
|
1999-12-17 10:00:13 -05:00
|
|
|
end
|
|
|
|
|
2003-07-01 22:34:39 -04:00
|
|
|
end # class POPMail
|
1999-10-13 03:29:15 -04:00
|
|
|
|
1999-09-22 03:32:33 -04:00
|
|
|
|
2003-08-05 12:12:05 -04:00
|
|
|
class POP3Command #:nodoc: internal use only
|
1999-12-17 10:00:13 -05:00
|
|
|
|
|
|
|
def initialize( sock )
|
2003-05-02 10:35:01 -04:00
|
|
|
@socket = sock
|
2003-07-01 22:34:39 -04:00
|
|
|
@error_occured = false
|
2003-05-02 10:35:01 -04:00
|
|
|
res = check_response(critical { recv_response() })
|
|
|
|
@apop_stamp = res.slice(/<.+>/)
|
1999-12-17 10:00:13 -05:00
|
|
|
end
|
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
def inspect
|
|
|
|
"#<#{self.class} socket=#{@socket}>"
|
|
|
|
end
|
1999-09-22 03:32:33 -04:00
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
def auth( account, password )
|
2003-07-01 22:34:39 -04:00
|
|
|
check_response_auth(critical {
|
|
|
|
check_response_auth(get_response('USER ' + account))
|
|
|
|
get_response('PASS ' + password)
|
|
|
|
})
|
2003-05-02 10:35:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def apop( account, password )
|
2003-05-04 02:04:03 -04:00
|
|
|
raise POPAuthenticationError, 'not APOP server; cannot login' \
|
2003-05-02 10:35:01 -04:00
|
|
|
unless @apop_stamp
|
|
|
|
check_response_auth(critical {
|
2003-07-01 22:34:39 -04:00
|
|
|
get_response('APOP %s %s',
|
|
|
|
account,
|
|
|
|
Digest::MD5.hexdigest(@apop_stamp + password))
|
2003-05-02 10:35:01 -04:00
|
|
|
})
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def list
|
2003-05-02 10:35:01 -04:00
|
|
|
critical {
|
2003-07-01 22:34:39 -04:00
|
|
|
getok 'LIST'
|
|
|
|
list = []
|
|
|
|
@socket.each_list_item do |line|
|
|
|
|
m = /\A(\d+)[ \t]+(\d+)/.match(line) or
|
|
|
|
raise POPBadResponse, "bad response: #{line}"
|
|
|
|
list.push [m[1].to_i, m[2].to_i]
|
|
|
|
end
|
|
|
|
return list
|
2003-03-09 11:53:30 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def stat
|
2003-05-02 10:35:01 -04:00
|
|
|
res = check_response(critical { get_response('STAT') })
|
|
|
|
m = /\A\+OK\s+(\d+)\s+(\d+)/.match(res) or
|
|
|
|
raise POPBadResponse, "wrong response format: #{res}"
|
|
|
|
[m[1].to_i, m[2].to_i]
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def rset
|
2003-05-04 02:04:03 -04:00
|
|
|
check_response(critical { get_response 'RSET' })
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
2003-07-01 22:34:39 -04:00
|
|
|
def top( num, lines = 0, &block )
|
2003-05-02 10:35:01 -04:00
|
|
|
critical {
|
2003-07-01 22:34:39 -04:00
|
|
|
getok('TOP %d %d', num, lines)
|
|
|
|
@socket.each_message_chunk(&block)
|
2000-03-27 10:52:27 -05:00
|
|
|
}
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
2003-07-01 22:34:39 -04:00
|
|
|
def retr( num, &block )
|
2003-05-02 10:35:01 -04:00
|
|
|
critical {
|
2003-07-01 22:34:39 -04:00
|
|
|
getok('RETR %d', num)
|
|
|
|
@socket.each_message_chunk(&block)
|
2000-03-27 10:52:27 -05:00
|
|
|
}
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def dele( num )
|
2003-05-02 10:35:01 -04:00
|
|
|
check_response(critical { get_response('DELE %d', num) })
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
def uidl( num = nil )
|
|
|
|
if num
|
|
|
|
res = check_response(critical { get_response('UIDL %d', num) })
|
2003-07-01 22:34:39 -04:00
|
|
|
return res.split(/ /)[1]
|
2003-05-02 10:35:01 -04:00
|
|
|
else
|
|
|
|
critical {
|
2003-07-01 22:34:39 -04:00
|
|
|
getok('UIDL')
|
|
|
|
table = {}
|
|
|
|
@socket.each_list_item do |line|
|
|
|
|
num, uid = line.split
|
|
|
|
table[num.to_i] = uid
|
|
|
|
end
|
|
|
|
return table
|
2003-05-02 10:35:01 -04:00
|
|
|
}
|
|
|
|
end
|
1999-10-18 05:03:16 -04:00
|
|
|
end
|
|
|
|
|
2000-03-27 10:52:27 -05:00
|
|
|
def quit
|
2003-05-02 10:35:01 -04:00
|
|
|
check_response(critical { get_response('QUIT') })
|
2000-03-27 10:52:27 -05:00
|
|
|
end
|
1999-09-22 03:32:33 -04:00
|
|
|
|
2000-03-27 10:52:27 -05:00
|
|
|
private
|
1999-09-22 03:32:33 -04:00
|
|
|
|
2003-07-01 22:34:39 -04:00
|
|
|
def getok( fmt, *fargs )
|
|
|
|
@socket.writeline sprintf(fmt, *fargs)
|
2003-05-02 10:35:01 -04:00
|
|
|
check_response(recv_response())
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
2003-07-01 22:34:39 -04:00
|
|
|
def get_response( fmt, *fargs )
|
|
|
|
@socket.writeline sprintf(fmt, *fargs)
|
2003-05-02 10:35:01 -04:00
|
|
|
recv_response()
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
def recv_response
|
|
|
|
@socket.readline
|
|
|
|
end
|
1999-09-22 03:32:33 -04:00
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
def check_response( res )
|
|
|
|
raise POPError, res unless /\A\+OK/i === res
|
|
|
|
res
|
|
|
|
end
|
1999-09-22 03:32:33 -04:00
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
def check_response_auth( res )
|
|
|
|
raise POPAuthenticationError, res unless /\A\+OK/i === res
|
|
|
|
res
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
2003-05-02 10:35:01 -04:00
|
|
|
def critical
|
2003-07-01 22:34:39 -04:00
|
|
|
return '+OK dummy ok response' if @error_occured
|
|
|
|
begin
|
|
|
|
return yield()
|
|
|
|
rescue Exception
|
|
|
|
@error_occured = true
|
|
|
|
raise
|
|
|
|
end
|
1999-09-22 03:32:33 -04:00
|
|
|
end
|
|
|
|
|
2003-07-01 22:34:39 -04:00
|
|
|
end # class POP3Command
|
1999-09-22 03:32:33 -04:00
|
|
|
|
aamine
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb:
add module Net::NetPrivate and its inner classes
{Read,Write}Adapter, Command, Socket,
SMTPCommand, POP3Command, APOPCommand, HTTPCommand
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-07-12 02:04:40 -04:00
|
|
|
end # module Net
|
2003-08-05 09:22:20 -04:00
|
|
|
|