@@ -61,6 +61,13 @@ module Net
61
61
# are expunged from the mailbox, remaining messages have their
62
62
# sequence numbers "shuffled down" to fill the gaps.
63
63
#
64
+ # To avoid sequence number race conditions, servers must not expunge messages
65
+ # when no command is in progress, nor when responding to #fetch, #store, or
66
+ # #search. Expunges _may_ be sent during any other command, including
67
+ # #uid_fetch, #uid_store, and #uid_search. The #noop and #idle commands are
68
+ # both useful for this side-effect: they allow the server to send all mailbox
69
+ # updates, including expunges.
70
+ #
64
71
# UIDs, on the other hand, are permanently guaranteed not to
65
72
# identify another message within the same mailbox, even if
66
73
# the existing message is deleted. UIDs are required to
@@ -530,6 +537,14 @@ def id(client_id=nil)
530
537
# Sends a {NOOP command [IMAP4rev1 §6.1.2]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.1.2]
531
538
# to the server.
532
539
#
540
+ # This allows the server to send unsolicited untagged EXPUNGE #responses,
541
+ # but does not execute any client request. \IMAP servers are permitted to
542
+ # send unsolicited untagged responses at any time, except for `EXPUNGE`.
543
+ #
544
+ # * +EXPUNGE+ can only be sent while a command is in progress.
545
+ # * +EXPUNGE+ must _not_ be sent during #fetch, #store, or #search.
546
+ # * +EXPUNGE+ may be sent during #uid_fetch, #uid_store, or #uid_search.
547
+ #
533
548
# Related: #idle, #check
534
549
def noop
535
550
send_command ( "NOOP" )
@@ -1138,7 +1153,7 @@ def expunge
1138
1153
# to permanently remove all messages that have both the <tt>\\Deleted</tt>
1139
1154
# flag set and a UID that is included in +uid_set+.
1140
1155
#
1141
- # By using UID EXPUNGE instead of EXPUNGE when resynchronizing with
1156
+ # By using #uid_expunge instead of #expunge when resynchronizing with
1142
1157
# the server, the client can ensure that it does not inadvertantly
1143
1158
# remove any messages that have been marked as <tt>\\Deleted</tt> by other
1144
1159
# clients between the time that the client was last connected and
0 commit comments