@@ -80,7 +80,7 @@ module Net
80
80
# ==== List sender and subject of all recent messages in the default mailbox
81
81
#
82
82
# imap = Net::IMAP.new('mail.example.com')
83
- # imap.authenticate('LOGIN ', 'joe_user', 'joes_password')
83
+ # imap.authenticate('PLAIN ', 'joe_user', 'joes_password')
84
84
# imap.examine('INBOX')
85
85
# imap.search(["RECENT"]).each do |message_id|
86
86
# envelope = imap.fetch(message_id, "ENVELOPE")[0].attr["ENVELOPE"]
@@ -90,7 +90,7 @@ module Net
90
90
# ==== Move all messages from April 2003 from "Mail/sent-mail" to "Mail/sent-apr03"
91
91
#
92
92
# imap = Net::IMAP.new('mail.example.com')
93
- # imap.authenticate('LOGIN ', 'joe_user', 'joes_password')
93
+ # imap.authenticate('PLAIN ', 'joe_user', 'joes_password')
94
94
# imap.select('Mail/sent-mail')
95
95
# if not imap.list('Mail/', 'sent-apr03')
96
96
# imap.create('Mail/sent-apr03')
@@ -190,7 +190,7 @@ module Net
190
190
# Net::IMAP supports concurrent threads. For example,
191
191
#
192
192
# imap = Net::IMAP.new("imap.foo.net", "imap2")
193
- # imap.authenticate("cram -md5", "bar", "password")
193
+ # imap.authenticate("scram -md5", "bar", "password")
194
194
# imap.select("inbox")
195
195
# fetch_thread = Thread.start { imap.fetch(1..-1, "UID") }
196
196
# search_result = imap.search(["BODY", "hello"])
@@ -772,13 +772,18 @@ class << self
772
772
# status # => "OK"
773
773
# # The client is connected in the "Not Authenticated" state.
774
774
#
775
- # Connect with TLS to port 993 at mail.example.com:
775
+ # Connect with TLS to port 993
776
776
# imap = Net::IMAP.new('mail.example.com', ssl: true) # => #<Net::IMAP:0x00007f79b0872bd0>
777
777
# imap.port => 993
778
778
# imap.tls_verified? => true
779
- # imap.greeting => name: ("OK" | "PREAUTH") => status
780
- # status # => "OK"
781
- # # The client is connected in the "Not Authenticated" state.
779
+ # imap.greeting => name: (/OK/i | /PREAUTH/i) => status
780
+ # case status
781
+ # in /OK/i
782
+ # # The client is connected in the "Not Authenticated" state.
783
+ # imap.authenticate("PLAIN", "joe_user", "joes_password")
784
+ # in /PREAUTH/i
785
+ # # The client is connected in the "Authenticated" state.
786
+ # end
782
787
#
783
788
# Connect with prior authentication, for example using an SSL certificate:
784
789
# ssl_ctx_params = {
0 commit comments