net-imap 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of net-imap might be problematic. Click here for more details.

@@ -4,26 +4,28 @@ module Net
4
4
  class IMAP < Protocol
5
5
 
6
6
  # -------------------------------------------------------------------------
7
- # :section: Message Flags: system flags
7
+ # :section: System Flags
8
8
  #
9
9
  # A message has a list of zero or more named tokens, known as "flags",
10
10
  # associated with it. A flag is set by its addition to this list and is
11
- # cleared by its removal. There are two types of flags in IMAP4rev2: system
12
- # flags and keywords. A flag of either type can be permanent or
13
- # session-only.
11
+ # cleared by its removal. There are two types of flags in
12
+ # IMAP4rev1[https://www.rfc-editor.org/rfc/rfc3501.html] and
13
+ # IMAP4rev2[https://www.rfc-editor.org/rfc/rfc9051.html]: flags and
14
+ # keywords. A flag of either type can be permanent or session-only.
14
15
  #
15
- # A "system flag" is a message flag name that is predefined in the IMAP
16
- # specification and begins with "\". +Net::IMAP+ returns all system flags
17
- # as symbols, without the "\" prefix.
16
+ # A "system flag" is a message flag name that is predefined in the \IMAP
17
+ # specifications and begins with <tt>"\"</tt>. Net::IMAP returns all
18
+ # system flags as symbols, without the <tt>"\"</tt> prefix.
18
19
  #
19
- # The descriptions here were copied from the IMAP4rev2 specification:
20
- # [RFC-9051 § 2.3.2](https://www.rfc-editor.org/rfc/rfc9051.html#section-2.3.2)
21
- #
22
- # See [RFC-3501 § 2.3.2](https://www.rfc-editor.org/rfc/rfc3501.html#section-2.3.2)
23
- # for a description of the flags message attribute and system flag semantics
24
- # in IMAP4rev1.
20
+ # <em>The descriptions here were copied from</em> {[RFC-9051
21
+ # §2.3.2]}[https://www.rfc-editor.org/rfc/rfc9051.html#section-2.3.2].
22
+ # <em>See also</em> {[RFC-3501
23
+ # §2.3.2]}[https://www.rfc-editor.org/rfc/rfc3501.html#section-2.3.2],
24
+ # <em>which describes the flags message attribute semantics under</em>
25
+ # IMAP4rev1[https://www.rfc-editor.org/rfc/rfc3501.html].
25
26
  # -------------------------------------------------------------------------
26
27
 
28
+ ##
27
29
  # Flag indicating a message has been read.
28
30
  SEEN = :Seen
29
31
 
@@ -52,30 +54,37 @@ module Net
52
54
  # of this message.
53
55
  #
54
56
  # This flag was defined by
55
- # IMAP4rev1 [RFC-3501](https://www.rfc-editor.org/rfc/rfc3501.html),
56
- # and has been deprecated by
57
- # IMAP4rev2 [RFC-9051](https://www.rfc-editor.org/rfc/rfc9051.html).
57
+ # IMAP4rev1[https://www.rfc-editor.org/rfc/rfc3501.html]
58
+ # and is deprecated by
59
+ # IMAP4rev2[https://www.rfc-editor.org/rfc/rfc9051.html].
58
60
  RECENT = :Recent
59
61
 
60
62
  # -------------------------------------------------------------------------
61
- # :section: Mailbox Name Attributes, Base attributes
62
- # Mailbox name attributes will be returned in LIST responses. Base
63
+ # :section: Basic Mailbox Attributes
64
+ # Mailbox name attributes will be returned in #list responses. Base
63
65
  # attributes must be returned according to the server's capabilities.
64
66
  #
65
67
  # IMAP4 specifies that all mailbox name attributes, including future
66
- # extensions, begin with "\". +Net::IMAP+ returns all mailbox attributes as
67
- # symbols, without the "\" prefix.
68
+ # extensions, begin with <tt>"\"</tt>. Net::IMAP returns all mailbox
69
+ # attributes as symbols, without the <tt>"\"</tt> prefix.
70
+ #
71
+ # Mailbox name attributes are not case-sensitive. <em>The current
72
+ # implementation</em> normalizes mailbox attribute case using
73
+ # String#capitalize, such as +:Noselect+ (not +:NoSelect+). The constants
74
+ # (such as NO_SELECT) can also be used for comparison. The contants have
75
+ # been defined both with and without underscores between words.
68
76
  #
69
- # The descriptions here were copied from the IMAP4rev2 specification:
70
- # [RFC9051 § 7.3.1](https://www.rfc-editor.org/rfc/rfc9051.html#section-7.3.1).
77
+ # <em>The descriptions here were copied from</em> {[RFC-9051 §
78
+ # 7.3.1]}[https://www.rfc-editor.org/rfc/rfc9051.html#section-7.3.1].
71
79
  #
72
- # Other mailbox name attributes can be found in the [IANA IMAP Mailbox Name
73
- # Attributes registry](https://www.iana.org/assignments/imap-mailbox-name-attributes/imap-mailbox-name-attributes.xhtml)].
80
+ # Other mailbox name attributes can be found in the {IANA IMAP Mailbox Name
81
+ # Attributes registry}[https://www.iana.org/assignments/imap-mailbox-name-attributes/imap-mailbox-name-attributes.xhtml].
74
82
  # -------------------------------------------------------------------------
75
83
 
76
- # The "\NonExistent" attribute indicates that a mailbox name does not refer
84
+ ##
85
+ # The +\NonExistent+ attribute indicates that a mailbox name does not refer
77
86
  # to an existing mailbox. Note that this attribute is not meaningful by
78
- # itself, as mailbox names that match the canonical LIST pattern but don't
87
+ # itself, as mailbox names that match the canonical #list pattern but don't
79
88
  # exist must not be returned unless one of the two conditions listed below
80
89
  # is also satisfied:
81
90
  #
@@ -84,91 +93,103 @@ module Net
84
93
  # specified).
85
94
  #
86
95
  # 2. "RECURSIVEMATCH" has been specified, and the mailbox name has at least
87
- # one descendant mailbox name that does not match the LIST pattern and
96
+ # one descendant mailbox name that does not match the #list pattern and
88
97
  # does match the selection criteria.
89
98
  #
90
- # In practice, this means that the "\NonExistent" attribute is usually
91
- # returned with one or more of "\Subscribed", "\Remote", "\HasChildren", or
99
+ # In practice, this means that the +\NonExistent+ attribute is usually
100
+ # returned with one or more of +\Subscribed+, +\Remote+, +\HasChildren+, or
92
101
  # the CHILDINFO extended data item.
93
102
  #
94
- # The client must treat the presence of the \NonExistent attribute as if the
95
- # \NoSelect attribute was also sent by the server
96
- NONEXISTENT = :NonExistent
103
+ # The client must treat the presence of the +\NonExistent+ attribute as if the
104
+ # +\NoSelect+ attribute was also sent by the server
105
+ NONEXISTENT = :Nonexistent
97
106
 
98
107
  # Mailbox attribute indicating it is not possible for any child levels of
99
108
  # hierarchy to exist under this name; no child levels exist now and none can
100
109
  # be created in the future children.
101
110
  #
102
- # The client must treat the presence of the \NoInferiors attribute as if the
103
- # \HasNoChildren attribute was also sent by the server
104
- NOINFERIORS = :Noinferiors
111
+ # The client must treat the presence of the +\NoInferiors+ attribute as if the
112
+ # +\HasNoChildren+ attribute was also sent by the server
113
+ NO_INFERIORS = :Noinferiors
105
114
 
106
115
  # Mailbox attribute indicating it is not possible to use this name as a
107
116
  # selectable mailbox.
108
- NOSELECT = :Noselect
117
+ NO_SELECT = :Noselect
109
118
 
110
119
  # The presence of this attribute indicates that the mailbox has child
111
120
  # mailboxes. A server SHOULD NOT set this attribute if there are child
112
121
  # mailboxes and the user does not have permission to access any of them. In
113
- # this case, \HasNoChildren SHOULD be used. In many cases, however, a server
114
- # may not be able to efficiently compute whether a user has access to any
115
- # child mailboxes. Note that even though the \HasChildren attribute for a
116
- # mailbox must be correct at the time of processing the mailbox, a client
117
- # must be prepared to deal with a situation when a mailbox is marked with
118
- # the \HasChildren attribute, but no child mailbox appears in the response
119
- # to the LIST command. This might happen, for example, due to child
122
+ # this case, +\HasNoChildren+ SHOULD be used. In many cases, however, a
123
+ # server may not be able to efficiently compute whether a user has access to
124
+ # any child mailboxes. Note that even though the +\HasChildren+ attribute
125
+ # for a mailbox must be correct at the time of processing the mailbox, a
126
+ # client must be prepared to deal with a situation when a mailbox is marked
127
+ # with the +\HasChildren+ attribute, but no child mailbox appears in the
128
+ # response to the #list command. This might happen, for example, due to child
120
129
  # mailboxes being deleted or made inaccessible to the user (using access
121
130
  # control) by another client before the server is able to list them.
122
131
  #
123
- # It is an error for the server to return both a \HasChildren and a
124
- # \HasNoChildren attribute in the same LIST response. A client that
125
- # encounters a LIST response with both \HasChildren and \HasNoChildren
126
- # attributes present should act as if both are absent in the LIST response.
127
- HAS_CHILDREN = :HasChildren
132
+ # It is an error for the server to return both a +\HasChildren+ and a
133
+ # +\HasNoChildren+ attribute in the same #list response. A client that
134
+ # encounters a #list response with both +\HasChildren+ and +\HasNoChildren+
135
+ # attributes present should act as if both are absent in the #list response.
136
+ HAS_CHILDREN = :Haschildren
128
137
 
129
138
  # The presence of this attribute indicates that the mailbox has NO child
130
139
  # mailboxes that are accessible to the currently authenticated user.
131
140
  #
132
- # It is an error for the server to return both a \HasChildren and a
133
- # \HasNoChildren attribute in the same LIST response. A client that
134
- # encounters a LIST response with both \HasChildren and \HasNoChildren
135
- # attributes present should act as if both are absent in the LIST response.
141
+ # It is an error for the server to return both a +\HasChildren+ and a
142
+ # +\HasNoChildren+ attribute in the same #list response. A client that
143
+ # encounters a #list response with both +\HasChildren+ and +\HasNoChildren+
144
+ # attributes present should act as if both are absent in the #list response.
136
145
  #
137
- # Note: the \HasNoChildren attribute should not be confused with the
138
- # \NoInferiors attribute, which indicates that no child mailboxes exist now
139
- # and none can be created in the future.
140
- HAS_NO_CHILDREN = :HasNoChildren
146
+ # Note: the +\HasNoChildren+ attribute should not be confused with the
147
+ # +\NoInferiors+ attribute, which indicates that no child mailboxes exist
148
+ # now and none can be created in the future.
149
+ HAS_NO_CHILDREN = :Hasnochildren
141
150
 
142
151
  # The mailbox has been marked "interesting" by the server; the mailbox
143
152
  # probably contains messages that have been added since the last time the
144
153
  # mailbox was selected.
145
154
  #
146
155
  # If it is not feasible for the server to determine whether or not the
147
- # mailbox is "interesting", the server SHOULD NOT send either \Marked or
148
- # \Unmarked. The server MUST NOT send more than one of \Marked, \Unmarked,
149
- # and \Noselect for a single mailbox, and it MAY send none of these.
156
+ # mailbox is "interesting", the server SHOULD NOT send either +\Marked+ or
157
+ # +\Unmarked+. The server MUST NOT send more than one of +\Marked+,
158
+ # +\Unmarked+, and +\NoSelect+ for a single mailbox, and it MAY send none of
159
+ # these.
150
160
  MARKED = :Marked
151
161
 
152
162
  # The mailbox does not contain any additional messages since the last time
153
163
  # the mailbox was selected.
154
164
  #
155
165
  # If it is not feasible for the server to determine whether or not the
156
- # mailbox is "interesting", the server SHOULD NOT send either \Marked or
157
- # \Unmarked. The server MUST NOT send more than one of \Marked, \Unmarked,
158
- # and \Noselect for a single mailbox, and it MAY send none of these.
166
+ # mailbox is "interesting", the server SHOULD NOT send either +\Marked+ or
167
+ # +\Unmarked+. The server MUST NOT send more than one of +\Marked+,
168
+ # +\Unmarked+, and +\NoSelect+ for a single mailbox, and it MAY send none of
169
+ # these.
159
170
  UNMARKED = :Unmarked
160
171
 
161
- # The mailbox name was subscribed to using the SUBSCRIBE command.
172
+ # The mailbox name was subscribed to using the #subscribe command.
162
173
  SUBSCRIBED = :Subscribed
163
174
 
164
175
  # The mailbox is a remote mailbox.
165
176
  REMOTE = :Remove
166
177
 
178
+ # Alias for NO_INFERIORS, to match the \IMAP spelling.
179
+ NOINFERIORS = NO_INFERIORS
180
+ # Alias for NO_SELECT, to match the \IMAP spelling.
181
+ NOSELECT = NO_SELECT
182
+ # Alias for HAS_CHILDREN, to match the \IMAP spelling.
183
+ HASCHILDREN = HAS_CHILDREN
184
+ # Alias for HAS_NO_CHILDREN, to match the \IMAP spelling.
185
+ HASNOCHILDREN = HAS_NO_CHILDREN
186
+
167
187
  # -------------------------------------------------------------------------
168
- # :section: Mailbox Name Attributes, Special Use
169
- # Mailbox name attributes will be returned in LIST responses. In addition
170
- # to the base mailbox name attributes defined above, an IMAP server MAY also
171
- # include any or all of the following attributes that denote "role" (or
188
+ # :section: Mailbox role attributes
189
+ #
190
+ # Mailbox name attributes will be returned in #list responses. In addition
191
+ # to the base mailbox name attributes defined above, an \IMAP server MAY
192
+ # also include any or all of the following attributes that denote "role" (or
172
193
  # "special-use") of a mailbox. These attributes are included along with base
173
194
  # attributes defined above. A given mailbox may have none, one, or more than
174
195
  # one of these attributes. In some cases, a special use is advice to a
@@ -176,14 +197,18 @@ module Net
176
197
  # client about what to expect to find there.
177
198
  #
178
199
  # IMAP4 specifies that all mailbox name attributes, including future
179
- # extensions, begin with "\". +Net::IMAP+ returns all mailbox attributes as
180
- # symbols, without the "\" prefix.
200
+ # extensions, begin with <tt>"\"</tt>. Net::IMAP returns all mailbox
201
+ # attributes as symbols, without the <tt>"\"</tt> prefix.
202
+ #
203
+ # The special use attributes were first defined as part of the
204
+ # SPECIAL-USE[https://www.rfc-editor.org/rfc/rfc6154.html] extension, but
205
+ # servers may return them without including the +SPECIAL-USE+ #capability.
181
206
  #
182
- # The descriptions here were copied from the IMAP4rev2 specification:
183
- # [RFC-9051 § 7.3.1](https://www.rfc-editor.org/rfc/rfc9051.html#section-7.3.1).
207
+ # <em>The descriptions here were copied from</em> {[RFC-9051 §
208
+ # 7.3.1]}[https://www.rfc-editor.org/rfc/rfc9051.html#section-7.3.1].
184
209
  #
185
- # Other mailbox name attributes can be found in the [IANA IMAP Mailbox Name
186
- # Attributes registry](https://www.iana.org/assignments/imap-mailbox-name-attributes/imap-mailbox-name-attributes.xhtml)].
210
+ # Other mailbox name attributes can be found in the {IANA IMAP Mailbox Name
211
+ # Attributes registry}[https://www.iana.org/assignments/imap-mailbox-name-attributes/imap-mailbox-name-attributes.xhtml].
187
212
  # -------------------------------------------------------------------------
188
213
 
189
214
  # Mailbox attribute indicating that this mailbox presents all messages in
@@ -206,7 +231,9 @@ module Net
206
231
  # client put drafts here
207
232
  DRAFTS = :Drafts
208
233
 
209
- # FLAGGED is defined with the system flags section.
234
+ #--
235
+ # n.b. FLAGGED is defined in the system flags section.
236
+ #++
210
237
 
211
238
  # Mailbox attribute indicating that this mailbox is where messages deemed to
212
239
  # be junk mail are held. Some server implementations might put messages here
@@ -223,10 +250,10 @@ module Net
223
250
  # Mailbox attribute indicating that this mailbox is used to hold messages
224
251
  # that have been deleted or marked for deletion. In some server
225
252
  # implementations, this might be a virtual mailbox, containing messages from
226
- # other mailboxes that are marked with the "\Deleted" message flag.
253
+ # other mailboxes that are marked with the +\Deleted+ message flag.
227
254
  # Alternatively, this might just be advice that a client that chooses not to
228
- # use the IMAP "\Deleted" model should use as its trash location. In server
229
- # implementations that strictly expect the IMAP "\Deleted" model, this
255
+ # use the \IMAP +\Deleted+ model should use as its trash location. In server
256
+ # implementations that strictly expect the \IMAP +\Deleted+ model, this
230
257
  # special use is likely not to be supported.
231
258
  TRASH = :Trash
232
259