--- !ruby/object:RDoc::RI::ClassDescription 
attributes: 
- !ruby/object:RDoc::RI::Attribute 
  comment: 
  - !ruby/struct:RDoc::Markup::Flow::P 
    :body: The address to connect to.
  name: address
  rw: R
- !ruby/object:RDoc::RI::Attribute 
  comment: 
  - !ruby/struct:RDoc::Markup::Flow::P 
    :body: Seconds to wait until a connection is opened. If the POP3 object cannot open a connection within this time, it raises a TimeoutError exception.
  name: open_timeout
  rw: RW
- !ruby/object:RDoc::RI::Attribute 
  comment: 
  - !ruby/struct:RDoc::Markup::Flow::P 
    :body: 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.
  name: read_timeout
  rw: R
class_methods: 
- !ruby/object:RDoc::RI::MethodSummary 
  name: APOP
- !ruby/object:RDoc::RI::MethodSummary 
  name: auth_only
- !ruby/object:RDoc::RI::MethodSummary 
  name: certs
- !ruby/object:RDoc::RI::MethodSummary 
  name: create_ssl_params
- !ruby/object:RDoc::RI::MethodSummary 
  name: default_pop3_port
- !ruby/object:RDoc::RI::MethodSummary 
  name: default_pop3s_port
- !ruby/object:RDoc::RI::MethodSummary 
  name: default_port
- !ruby/object:RDoc::RI::MethodSummary 
  name: delete_all
- !ruby/object:RDoc::RI::MethodSummary 
  name: disable_ssl
- !ruby/object:RDoc::RI::MethodSummary 
  name: enable_ssl
- !ruby/object:RDoc::RI::MethodSummary 
  name: foreach
- !ruby/object:RDoc::RI::MethodSummary 
  name: new
- !ruby/object:RDoc::RI::MethodSummary 
  name: ssl_params
- !ruby/object:RDoc::RI::MethodSummary 
  name: start
- !ruby/object:RDoc::RI::MethodSummary 
  name: use_ssl?
- !ruby/object:RDoc::RI::MethodSummary 
  name: verify
comment: 
- !ruby/struct:RDoc::Markup::Flow::H 
  :level: 1
  :text: Net::POP3
- !ruby/struct:RDoc::Markup::Flow::H 
  :level: 2
  :text: What is This Library?
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: 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).
- !ruby/struct:RDoc::Markup::Flow::H 
  :level: 2
  :text: Examples
- !ruby/struct:RDoc::Markup::Flow::H 
  :level: 3
  :text: Retrieving Messages
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: This example retrieves messages from the server and deletes them on the server.
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: 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.
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "    require 'net/pop'\n\n    pop = Net::POP3.new('pop.example.com')\n    pop.start('YourAccount', 'YourPassword')             # (1)\n    if pop.mails.empty?\n      puts 'No mail.'\n    else\n      i = 0\n      pop.each_mail do |m|   # or &quot;pop.mails.each ...&quot;   # (2)\n        File.open(&quot;inbox/#{i}&quot;, 'w') do |f|\n          f.write m.pop\n        end\n        m.delete\n        i += 1\n      end\n      puts &quot;#{pop.mails.size} mails popped.&quot;\n    end\n    pop.finish                                           # (3)\n"
- !ruby/object:RDoc::Markup::Flow::LIST 
  contents: 
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: "1."
    :body: Call Net::POP3#start and start POP session.
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: "2."
    :body: Access messages by using POP3#each_mail and/or POP3#mails.
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: "3."
    :body: "Close POP session by calling POP3#finish or use the block form of #start."
  type: :NUMBER
- !ruby/struct:RDoc::Markup::Flow::H 
  :level: 3
  :text: Shortened Code
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: 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.
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "    require 'net/pop'\n\n    Net::POP3.start('pop.example.com', 110,\n                    'YourAccount', 'YourPassword') do |pop|\n      if pop.mails.empty?\n        puts 'No mail.'\n      else\n        i = 0\n        pop.each_mail do |m|   # or &quot;pop.mails.each ...&quot;\n          File.open(&quot;inbox/#{i}&quot;, 'w') do |f|\n            f.write m.pop\n          end\n          m.delete\n          i += 1\n        end\n        puts &quot;#{pop.mails.size} mails popped.&quot;\n      end\n    end\n"
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: "POP3#delete_all is an alternative for #each_mail and #delete."
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "    require 'net/pop'\n\n    Net::POP3.start('pop.example.com', 110,\n                    'YourAccount', 'YourPassword') do |pop|\n      if pop.mails.empty?\n        puts 'No mail.'\n      else\n        i = 1\n        pop.delete_all do |m|\n          File.open(&quot;inbox/#{i}&quot;, 'w') do |f|\n            f.write m.pop\n          end\n          i += 1\n        end\n      end\n    end\n"
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: And here is an even shorter example.
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "    require 'net/pop'\n\n    i = 0\n    Net::POP3.delete_all('pop.example.com', 110,\n                         'YourAccount', 'YourPassword') do |m|\n      File.open(&quot;inbox/#{i}&quot;, 'w') do |f|\n        f.write m.pop\n      end\n      i += 1\n    end\n"
- !ruby/struct:RDoc::Markup::Flow::H 
  :level: 3
  :text: Memory Space Issues
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: All the examples above get each message as one big string. This example avoids this.
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "    require 'net/pop'\n\n    i = 1\n    Net::POP3.delete_all('pop.example.com', 110,\n                         'YourAccount', 'YourPassword') do |m|\n      File.open(&quot;inbox/#{i}&quot;, 'w') do |f|\n        m.pop do |chunk|    # get a message little by little.\n          f.write chunk\n        end\n        i += 1\n      end\n    end\n"
- !ruby/struct:RDoc::Markup::Flow::H 
  :level: 3
  :text: Using APOP
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: "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:"
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "    require 'net/pop'\n\n    # Use APOP authentication if $isapop == true\n    pop = Net::POP3.APOP($is_apop).new('apop.example.com', 110)\n    pop.start(YourAccount', 'YourPassword') do |pop|\n      # Rest of the code is the same.\n    end\n"
- !ruby/struct:RDoc::Markup::Flow::H 
  :level: 3
  :text: Fetch Only Selected Mail Using 'UIDL' POP Command
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: If your POP server provides UIDL functionality, you can grab only selected mails from the POP server. e.g.
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "    def need_pop?( id )\n      # determine if we need pop this mail...\n    end\n\n    Net::POP3.start('pop.example.com', 110,\n                    'Your account', 'Your password') do |pop|\n      pop.mails.select { |m| need_pop?(m.unique_id) }.each do |m|\n        do_something(m.pop)\n      end\n    end\n"
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: 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.
constants: 
- !ruby/object:RDoc::RI::Constant 
  comment: 
  name: Revision
  value: "%q$Revision: 19776 $.split[1]"
full_name: Net::POP3
includes: []

instance_methods: 
- !ruby/object:RDoc::RI::MethodSummary 
  name: active?
- !ruby/object:RDoc::RI::MethodSummary 
  name: apop?
- !ruby/object:RDoc::RI::MethodSummary 
  name: auth_only
- !ruby/object:RDoc::RI::MethodSummary 
  name: command
- !ruby/object:RDoc::RI::MethodSummary 
  name: delete_all
- !ruby/object:RDoc::RI::MethodSummary 
  name: disable_ssl
- !ruby/object:RDoc::RI::MethodSummary 
  name: do_finish
- !ruby/object:RDoc::RI::MethodSummary 
  name: do_start
- !ruby/object:RDoc::RI::MethodSummary 
  name: each
- !ruby/object:RDoc::RI::MethodSummary 
  name: each_mail
- !ruby/object:RDoc::RI::MethodSummary 
  name: enable_ssl
- !ruby/object:RDoc::RI::MethodSummary 
  name: finish
- !ruby/object:RDoc::RI::MethodSummary 
  name: inspect
- !ruby/object:RDoc::RI::MethodSummary 
  name: logging
- !ruby/object:RDoc::RI::MethodSummary 
  name: mails
- !ruby/object:RDoc::RI::MethodSummary 
  name: n_bytes
- !ruby/object:RDoc::RI::MethodSummary 
  name: n_mails
- !ruby/object:RDoc::RI::MethodSummary 
  name: on_connect
- !ruby/object:RDoc::RI::MethodSummary 
  name: port
- !ruby/object:RDoc::RI::MethodSummary 
  name: read_timeout=
- !ruby/object:RDoc::RI::MethodSummary 
  name: reset
- !ruby/object:RDoc::RI::MethodSummary 
  name: set_debug_output
- !ruby/object:RDoc::RI::MethodSummary 
  name: start
- !ruby/object:RDoc::RI::MethodSummary 
  name: started?
- !ruby/object:RDoc::RI::MethodSummary 
  name: use_ssl?
name: POP3
superclass: Protocol
