@@ -435,19 +435,20 @@ def login(user, password)
435
435
# in the +mailbox+ can be accessed.
436
436
#
437
437
# After you have selected a mailbox, you may retrieve the
438
- # number of items in that mailbox from + @responses["EXISTS"][-1]+ ,
439
- # and the number of recent messages from + @responses["RECENT"][-1]+ .
438
+ # number of items in that mailbox from <code> @responses["EXISTS"][-1]</code> ,
439
+ # and the number of recent messages from <code> @responses["RECENT"][-1]</code> .
440
440
# Note that these values can change if new messages arrive
441
441
# during a session; see #add_response_handler for a way of
442
442
# detecting this event.
443
443
#
444
444
# A Net::IMAP::NoResponseError is raised if the mailbox does not
445
445
# exist or is for some reason non-selectable.
446
446
#
447
- # If the server supports the UIDPLUS extension it may return an additional
448
- # "NO" response with a "UIDNOTSTICKY" response code indicating that the
449
- # mailstore does not support persistent UIDs:
450
- # +@responses["NO"].last.code.name == "UIDNOTSTICKY"+
447
+ # If the server supports the [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]]
448
+ # extension it may return an additional "NO" response with a "UIDNOTSTICKY" response code
449
+ # indicating that the mailstore does not support persistent UIDs
450
+ # [1[https://www.rfc-editor.org/rfc/rfc4315.html#page-4]]:
451
+ # @responses["NO"].last.code.name == "UIDNOTSTICKY"
451
452
def select ( mailbox )
452
453
synchronize do
453
454
@responses . clear
@@ -758,8 +759,9 @@ def status(mailbox, attr)
758
759
# not exist (it is not created automatically), or if the flags,
759
760
# date_time, or message arguments contain errors.
760
761
#
761
- # If the server supports the UIDPLUS extension it returns an array
762
- # with the UIDVALIDITY and the assigned UID of the appended message.
762
+ # If the server supports the [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]]
763
+ # extension it returns an array with the UIDVALIDITY and the assigned UID of the
764
+ # appended message.
763
765
def append ( mailbox , message , flags = nil , date_time = nil )
764
766
args = [ ]
765
767
if flags
@@ -800,10 +802,27 @@ def expunge
800
802
end
801
803
802
804
# Similar to #expunge, but takes a set of unique identifiers as
803
- # argument.
804
- def uid_expunge ( set )
805
+ # argument. Sends a UID EXPUNGE command to permanently remove all
806
+ # messages that have both the \\Deleted flag set and a UID that is
807
+ # included in +uid_set+.
808
+ #
809
+ # By using UID EXPUNGE instead of EXPUNGE when resynchronizing with
810
+ # the server, the client can ensure that it does not inadvertantly
811
+ # remove any messages that have been marked as \\Deleted by other
812
+ # clients between the time that the client was last connected and
813
+ # the time the client resynchronizes.
814
+ #
815
+ # Note:: Although the command takes a +uid_set+ for its argument, the
816
+ # server still returns regular EXPUNGE responses, which contain
817
+ # a <em>sequence number</em>. These will be deleted from
818
+ # #responses and this method returns them as an array of
819
+ # <em>sequence number</em> integers.
820
+ #
821
+ # ==== Required capability
822
+ # +UIDPLUS+ - described in [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]].
823
+ def uid_expunge ( uid_set )
805
824
synchronize do
806
- send_command ( "UID EXPUNGE" , MessageSet . new ( set ) )
825
+ send_command ( "UID EXPUNGE" , MessageSet . new ( uid_set ) )
807
826
return @responses . delete ( "EXPUNGE" )
808
827
end
809
828
end
@@ -929,9 +948,9 @@ def uid_store(set, attr, flags)
929
948
# a number, an array of numbers, or a Range object. The number is
930
949
# a message sequence number.
931
950
#
932
- # If the server supports the UIDPLUS extension it returns an array with
933
- # the UIDVALIDITY, the UID set of the source messages and the assigned
934
- # UID set of the copied messages.
951
+ # If the server supports the [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]]
952
+ # extension it returns an array with the UIDVALIDITY, the UID set of the source messages
953
+ # and the assigned UID set of the copied messages.
935
954
def copy ( set , mailbox )
936
955
copy_internal ( "COPY" , set , mailbox )
937
956
end
@@ -948,9 +967,9 @@ def uid_copy(set, mailbox)
948
967
#
949
968
# The MOVE extension is described in [EXT-MOVE[https://tools.ietf.org/html/rfc6851]].
950
969
#
951
- # If the server supports the UIDPLUS extension it returns an array with
952
- # the UIDVALIDITY, the UID set of the source messages and the assigned
953
- # UID set of the moved messages.
970
+ # If the server supports the [ UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]]
971
+ # extension it returns an array with the UIDVALIDITY, the UID set of the source messages
972
+ # and the assigned UID set of the moved messages.
954
973
def move ( set , mailbox )
955
974
copy_internal ( "MOVE" , set , mailbox )
956
975
end
0 commit comments