@@ -407,6 +407,8 @@ class << self
407
407
end
408
408
409
409
# Disconnects from the server.
410
+ #
411
+ # Related: #logout
410
412
def disconnect
411
413
return if disconnected?
412
414
begin
@@ -430,6 +432,8 @@ def disconnect
430
432
end
431
433
432
434
# Returns true if disconnected from the server.
435
+ #
436
+ # Related: #logout, #disconnect
433
437
def disconnected?
434
438
return @sock . closed?
435
439
end
@@ -525,20 +529,26 @@ def id(client_id=nil)
525
529
526
530
# Sends a {NOOP command [IMAP4rev1 §6.1.2]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.1.2]
527
531
# to the server.
532
+ #
533
+ # Related: #idle, #check
528
534
def noop
529
535
send_command ( "NOOP" )
530
536
end
531
537
532
538
# Sends a {LOGOUT command [IMAP4rev1 §6.1.3]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.1.3]
533
539
# to inform the command to inform the server that the client is done with
534
540
# the connection.
541
+ #
542
+ # Related: #disconnect
535
543
def logout
536
544
send_command ( "LOGOUT" )
537
545
end
538
546
539
547
# Sends a {STARTTLS command [IMAP4rev1 §6.2.1]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.2.1]
540
548
# to start a TLS session.
541
549
#
550
+ # Related: Net::IMAP.new, #login, #authenticate
551
+ #
542
552
# ===== Capability
543
553
#
544
554
# The server's capabilities must include +STARTTLS+.
@@ -602,6 +612,8 @@ def starttls(options = {}, verify = true)
602
612
# See Net::IMAP::Authenticators for more information on plugging in your
603
613
# own authenticator.
604
614
#
615
+ # Related: #login, #starttls
616
+ #
605
617
# ==== Capabilities
606
618
#
607
619
# Clients MUST NOT attempt to #authenticate or #login when +LOGINDISABLED+
@@ -634,6 +646,8 @@ def authenticate(auth_type, *args)
634
646
#
635
647
# A Net::IMAP::NoResponseError is raised if authentication fails.
636
648
#
649
+ # Related: #authenticate, #starttls
650
+ #
637
651
# ==== Capabilities
638
652
# Clients MUST NOT attempt to #authenticate or #login when +LOGINDISABLED+
639
653
# is listed with the capabilities.
@@ -660,6 +674,8 @@ def login(user, password)
660
674
# A Net::IMAP::NoResponseError is raised if the mailbox does not
661
675
# exist or is for some reason non-selectable.
662
676
#
677
+ # Related: #examine
678
+ #
663
679
# ===== Capabilities
664
680
#
665
681
# If [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]] is supported,
@@ -681,6 +697,8 @@ def select(mailbox)
681
697
#
682
698
# A Net::IMAP::NoResponseError is raised if the mailbox does not
683
699
# exist or is for some reason non-examinable.
700
+ #
701
+ # Related: #select
684
702
def examine ( mailbox )
685
703
synchronize do
686
704
@responses . clear
@@ -693,6 +711,8 @@ def examine(mailbox)
693
711
#
694
712
# A Net::IMAP::NoResponseError is raised if a mailbox with that name
695
713
# cannot be created.
714
+ #
715
+ # Related: #rename, #delete
696
716
def create ( mailbox )
697
717
send_command ( "CREATE" , mailbox )
698
718
end
@@ -703,6 +723,8 @@ def create(mailbox)
703
723
# A Net::IMAP::NoResponseError is raised if a mailbox with that name
704
724
# cannot be deleted, either because it does not exist or because the
705
725
# client does not have permission to delete it.
726
+ #
727
+ # Related: #create, #rename
706
728
def delete ( mailbox )
707
729
send_command ( "DELETE" , mailbox )
708
730
end
@@ -714,6 +736,8 @@ def delete(mailbox)
714
736
# name +mailbox+ cannot be renamed to +newname+ for whatever
715
737
# reason; for instance, because +mailbox+ does not exist, or
716
738
# because there is already a mailbox with the name +newname+.
739
+ #
740
+ # Related: #create, #delete
717
741
def rename ( mailbox , newname )
718
742
send_command ( "RENAME" , mailbox , newname )
719
743
end
@@ -724,6 +748,8 @@ def rename(mailbox, newname)
724
748
#
725
749
# A Net::IMAP::NoResponseError is raised if +mailbox+ cannot be
726
750
# subscribed to; for instance, because it does not exist.
751
+ #
752
+ # Related: #unsubscribe, #lsub, #list
727
753
def subscribe ( mailbox )
728
754
send_command ( "SUBSCRIBE" , mailbox )
729
755
end
@@ -735,6 +761,8 @@ def subscribe(mailbox)
735
761
# A Net::IMAP::NoResponseError is raised if +mailbox+ cannot be
736
762
# unsubscribed from; for instance, because the client is not currently
737
763
# subscribed to it.
764
+ #
765
+ # Related: #subscribe, #lsub, #list
738
766
def unsubscribe ( mailbox )
739
767
send_command ( "UNSUBSCRIBE" , mailbox )
740
768
end
@@ -753,7 +781,11 @@ def unsubscribe(mailbox)
753
781
# which mailboxes to match. If +mailbox+ is empty, the root
754
782
# name of +refname+ and the hierarchy delimiter are returned.
755
783
#
756
- # The return value is an array of MailboxList. For example:
784
+ # The return value is an array of MailboxList.
785
+ #
786
+ # Related: #lsub, MailboxList
787
+ #
788
+ # ===== For example:
757
789
#
758
790
# imap.create("foo/bar")
759
791
# imap.create("foo/baz")
@@ -806,7 +838,9 @@ def list(refname, mailbox)
806
838
# of Namespace objects. These arrays will be empty when the
807
839
# server responds with nil.
808
840
#
809
- # For example:
841
+ # Related: #list, Namespaces, Namespace
842
+ #
843
+ # ===== For example:
810
844
#
811
845
# capabilities = imap.capability
812
846
# if capabilities.include?("NAMESPACE")
@@ -858,6 +892,8 @@ def namespace
858
892
# #<Net::IMAP::MailboxList attr=[:Noinferiors, :Marked], delim="/", name="foo/bar">, \\
859
893
# #<Net::IMAP::MailboxList attr=[:Noinferiors], delim="/", name="foo/baz">]
860
894
#
895
+ # Related: #list, MailboxList
896
+ #
861
897
# ===== Capabilities
862
898
#
863
899
# The server's capabilities must include +XLIST+,
@@ -879,6 +915,8 @@ def xlist(refname, mailbox)
879
915
# to both admin and user. If this mailbox exists, it returns an array
880
916
# containing objects of type MailboxQuotaRoot and MailboxQuota.
881
917
#
918
+ # Related: #getquota, #setquota, MailboxQuotaRoot, MailboxQuota
919
+ #
882
920
# ===== Capabilities
883
921
#
884
922
# The server's capabilities must include +QUOTA+
@@ -898,6 +936,8 @@ def getquotaroot(mailbox)
898
936
# containing a MailboxQuota object is returned. This command is generally
899
937
# only available to server admin.
900
938
#
939
+ # Related: #getquotaroot, #setquota, MailboxQuota
940
+ #
901
941
# ===== Capabilities
902
942
#
903
943
# The server's capabilities must include +QUOTA+
@@ -914,6 +954,8 @@ def getquota(mailbox)
914
954
# +quota+ will be unset for that mailbox. Typically one needs to be logged
915
955
# in as a server admin for this to work.
916
956
#
957
+ # Related: #getquota, #getquotaroot
958
+ #
917
959
# ===== Capabilities
918
960
#
919
961
# The server's capabilities must include +QUOTA+
@@ -932,6 +974,8 @@ def setquota(mailbox, quota)
932
974
# mailbox. If +rights+ is nil, then that user will be stripped of any
933
975
# rights to that mailbox.
934
976
#
977
+ # Related: #getacl
978
+ #
935
979
# ===== Capabilities
936
980
#
937
981
# The server's capabilities must include +ACL+
@@ -948,6 +992,8 @@ def setacl(mailbox, user, rights)
948
992
# along with a specified +mailbox+. If this mailbox exists, an array
949
993
# containing objects of MailboxACLItem will be returned.
950
994
#
995
+ # Related: #setacl, MailboxACLItem
996
+ #
951
997
# ===== Capabilities
952
998
#
953
999
# The server's capabilities must include +ACL+
@@ -965,6 +1011,8 @@ def getacl(mailbox)
965
1011
# interpreted as for #list.
966
1012
#
967
1013
# The return value is an array of MailboxList objects.
1014
+ #
1015
+ # Related: #subscribe, #unsubscribe, #list, MailboxList
968
1016
def lsub ( refname , mailbox )
969
1017
synchronize do
970
1018
send_command ( "LSUB" , refname , mailbox )
@@ -1040,6 +1088,8 @@ def append(mailbox, message, flags = nil, date_time = nil)
1040
1088
# to request a checkpoint of the currently selected mailbox. This performs
1041
1089
# implementation-specific housekeeping; for instance, reconciling the
1042
1090
# mailbox's in-memory and on-disk state.
1091
+ #
1092
+ # Related: #idle, #noop
1043
1093
def check
1044
1094
send_command ( "CHECK" )
1045
1095
end
@@ -1048,6 +1098,8 @@ def check
1048
1098
# to close the currently selected mailbox. The CLOSE command permanently
1049
1099
# removes from the mailbox all messages that have the <tt>\\Deleted</tt>
1050
1100
# flag set.
1101
+ #
1102
+ # Related: #unselect
1051
1103
def close
1052
1104
send_command ( "CLOSE" )
1053
1105
end
@@ -1058,6 +1110,8 @@ def close
1058
1110
# "_authenticated_" state. This is the same as #close, except that
1059
1111
# <tt>\\Deleted</tt> messages are not removed from the mailbox.
1060
1112
#
1113
+ # Related: #close
1114
+ #
1061
1115
# ===== Capabilities
1062
1116
#
1063
1117
# The server's capabilities must include +UNSELECT+
@@ -1069,6 +1123,8 @@ def unselect
1069
1123
# Sends an {EXPUNGE command [IMAP4rev1 §6.4.3]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.3]
1070
1124
# Sends a EXPUNGE command to permanently remove from the currently
1071
1125
# selected mailbox all messages that have the \Deleted flag set.
1126
+ #
1127
+ # Related: #uid_expunge
1072
1128
def expunge
1073
1129
synchronize do
1074
1130
send_command ( "EXPUNGE" )
@@ -1095,6 +1151,8 @@ def expunge
1095
1151
# #responses and this method returns them as an array of
1096
1152
# <em>sequence number</em> integers.
1097
1153
#
1154
+ # Related: #expunge
1155
+ #
1098
1156
# ===== Capabilities
1099
1157
#
1100
1158
# The server's capabilities must include +UIDPLUS+
@@ -1112,6 +1170,8 @@ def uid_expunge(uid_set)
1112
1170
# string holding the entire search string, or a single-dimension array of
1113
1171
# search keywords and arguments.
1114
1172
#
1173
+ # Related: #uid_search
1174
+ #
1115
1175
# ===== Search criteria
1116
1176
#
1117
1177
# The following are some common search criteria;
@@ -1183,7 +1243,9 @@ def uid_search(keys, charset = nil)
1183
1243
# The return value is an array of FetchData or nil
1184
1244
# (instead of an empty array) if there is no matching message.
1185
1245
#
1186
- # For example:
1246
+ # Related: #uid_search, FetchData
1247
+ #
1248
+ # ===== For example:
1187
1249
#
1188
1250
# p imap.fetch(6..8, "UID")
1189
1251
# #=> [#<Net::IMAP::FetchData seqno=6, attr={"UID"=>98}>, \\
@@ -1209,6 +1271,8 @@ def fetch(set, attr, mod = nil)
1209
1271
#
1210
1272
# Similar to #fetch, but the +set+ parameter contains unique identifiers
1211
1273
# instead of message sequence numbers.
1274
+ #
1275
+ # Related: #fetch, FetchData
1212
1276
def uid_fetch ( set , attr , mod = nil )
1213
1277
return fetch_internal ( "UID FETCH" , set , attr , mod )
1214
1278
end
@@ -1221,7 +1285,11 @@ def uid_fetch(set, attr, mod = nil)
1221
1285
# provided one, '+FLAGS' will add the provided flags, and '-FLAGS' will
1222
1286
# remove them. +flags+ is a list of flags.
1223
1287
#
1224
- # The return value is an array of FetchData. For example:
1288
+ # The return value is an array of FetchData
1289
+ #
1290
+ # Related: #uid_store
1291
+ #
1292
+ # ===== For example:
1225
1293
#
1226
1294
# p imap.store(6..8, "+FLAGS", [:Deleted])
1227
1295
# #=> [#<Net::IMAP::FetchData seqno=6, attr={"FLAGS"=>[:Seen, :Deleted]}>, \\
@@ -1237,6 +1305,8 @@ def store(set, attr, flags)
1237
1305
#
1238
1306
# Similar to #store, but +set+ contains unique identifiers instead of
1239
1307
# message sequence numbers.
1308
+ #
1309
+ # Related: #store
1240
1310
def uid_store ( set , attr , flags )
1241
1311
return store_internal ( "UID STORE" , set , attr , flags )
1242
1312
end
@@ -1246,6 +1316,8 @@ def uid_store(set, attr, flags)
1246
1316
# +mailbox+. The +set+ parameter is a number, an array of numbers, or a
1247
1317
# Range object. The number is a message sequence number.
1248
1318
#
1319
+ # Related: #uid_copy
1320
+ #
1249
1321
# ===== Capabilities
1250
1322
#
1251
1323
# If +UIDPLUS+ [RFC4315[https://www.rfc-editor.org/rfc/rfc4315.html]] is
@@ -1275,6 +1347,8 @@ def uid_copy(set, mailbox)
1275
1347
# +mailbox+. The +set+ parameter is a number, an array of numbers, or a
1276
1348
# Range object. The number is a message sequence number.
1277
1349
#
1350
+ # Related: #uid_move
1351
+ #
1278
1352
# ===== Capabilities
1279
1353
#
1280
1354
# The server's capabilities must include +MOVE+
@@ -1296,6 +1370,8 @@ def move(set, mailbox)
1296
1370
#
1297
1371
# Similar to #move, but +set+ contains unique identifiers.
1298
1372
#
1373
+ # Related: #move
1374
+ #
1299
1375
# ===== Capabilities
1300
1376
#
1301
1377
# Same as #move: The server's capabilities must include +MOVE+
@@ -1309,6 +1385,8 @@ def uid_move(set, mailbox)
1309
1385
# to sort messages in the mailbox. Returns an array of message sequence
1310
1386
# numbers.
1311
1387
#
1388
+ # Related: #uid_sort, #search, #uid_search, #thread, #uid_thread
1389
+ #
1312
1390
# ===== For example:
1313
1391
#
1314
1392
# p imap.sort(["FROM"], ["ALL"], "US-ASCII")
@@ -1327,6 +1405,8 @@ def sort(sort_keys, search_keys, charset)
1327
1405
# Sends a {UID SORT command [RFC5256 §3]}[https://www.rfc-editor.org/rfc/rfc5256#section-3]
1328
1406
# to sort messages in the mailbox. Returns an array of unique identifiers.
1329
1407
#
1408
+ # Related: #sort, #search, #uid_search, #thread, #uid_thread
1409
+ #
1330
1410
# ===== Capabilities
1331
1411
#
1332
1412
# The server's capabilities must include +SORT+
@@ -1369,6 +1449,8 @@ def remove_response_handler(handler)
1369
1449
# Unlike #search, +charset+ is a required argument. US-ASCII
1370
1450
# and UTF-8 are sample values.
1371
1451
#
1452
+ # Related: #uid_thread, #search, #uid_search, #sort, #uid_sort
1453
+ #
1372
1454
# ===== Capabilities
1373
1455
#
1374
1456
# The server's capabilities must include +THREAD+
@@ -1381,6 +1463,8 @@ def thread(algorithm, search_keys, charset)
1381
1463
# Similar to #thread, but returns unique identifiers instead of
1382
1464
# message sequence numbers.
1383
1465
#
1466
+ # Related: #thread, #search, #uid_search, #sort, #uid_sort
1467
+ #
1384
1468
# ===== Capabilities
1385
1469
#
1386
1470
# The server's capabilities must include +THREAD+
@@ -1406,6 +1490,8 @@ def uid_thread(algorithm, search_keys, charset)
1406
1490
# end
1407
1491
# end
1408
1492
#
1493
+ # Related: #idle_done, #noop, #check
1494
+ #
1409
1495
# ===== Capabilities
1410
1496
#
1411
1497
# The server's capabilities must include +IDLE+
@@ -1440,6 +1526,8 @@ def idle(timeout = nil, &response_handler)
1440
1526
end
1441
1527
1442
1528
# Leaves IDLE.
1529
+ #
1530
+ # Related: #idle
1443
1531
def idle_done
1444
1532
synchronize do
1445
1533
if @idle_done_cond . nil?
0 commit comments