Module: Net::IMAP::ResponseParser::Patterns
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
|
|
Defined in: | lib/net/imap/response_parser.rb |
Constant Summary
-
ASTRING_CHAR =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 174CHAR - ASTRING_SPECIALS
-
ASTRING_CHARS =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 178/#{ASTRING_CHAR}+/n
-
ASTRING_SPECIALS =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 172/[(){ \x00-\x1f\x7f%*"\\]/n
-
ATOM =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 177/#{ATOM_CHAR}+/n
-
ATOMISH =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 179/#{ATOM_CHAR - /[\[]/ }+/
-
ATOM_CHAR =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 175CHAR - ATOM_SPECIALS
-
ATOM_SPECIALS =
Internal use only
atomish = 1*<any ATOM-CHAR except “[”>
; We use "atomish" for msg-att and section, in order ; to simplify "BODY[HEADER.FIELDS (foo bar)]".
atom-specials = “(” / “)” / “{” / SP / CTL / list-wildcards /
quoted-specials / resp-specials
ATOM-CHAR = <any CHAR except atom-specials> atom = 1*ATOM-CHAR ASTRING-CHAR = ATOM-CHAR / resp-specials tag = 1*<any ASTRING-CHAR except “+”>
/[(){ \x00-\x1f\x7f%*"\\\]]/n
-
CHAR8 =
Internal use only
CHAR8
= %x01-ff; any OCTET except NUL, %x00
/[\x01-\xff]/n
-
CODE_TEXT =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 187/#{CODE_TEXT_CHAR}+/n
-
CODE_TEXT_CHAR =
Internal use only
resp-text-code = … / atom [SP 1*<any TEXT-CHAR except “]”>]
TEXT_CHAR - RESP_SPECIALS
-
FLAG =
Internal use only
flag = “Answered” / “Flagged” / “Deleted” /
"\Seen" / "\Draft" / flag-keyword / flag-extension ; Does not include "\Recent"
flag-extension = “" atom
; Future expansion. Client implementations ; MUST accept flag-extension flags. Server ; implementations MUST NOT generate ; flag-extension flags except as defined by ; a future Standard or Standards Track ; revisions of this specification.
flag-keyword = “$MDNSent” / “$Forwarded” / “$Junk” /
"$NotJunk" / "$Phishing" / atom
flag-perm = flag / “*”
Not checking for max one mbx-list-sflag in the parser.
mbx-list-oflag = “Noinferiors” / child-mbox-flag /
"\Subscribed" / "\Remote" / flag-extension ; Other flags; multiple from this list are ; possible per LIST response, but each flag ; can only appear once per LIST response
mbx-list-sflag = “NonExistent” / “Noselect” / “Marked” /
"\Unmarked" ; Selectability flags; only one per LIST response
child-mbox-flag = “HasChildren” / “HasNoChildren”
; attributes for the CHILDREN return option, at most ; one possible per LIST response
/\\?#{ATOM}/n
-
FLAG_EXTENSION =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 218/\\#{ATOM}/n
-
FLAG_KEYWORD =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 219ATOM
-
FLAG_LIST =
Internal use only
/\G\((#{FLAG }(?:#{SP}#{FLAG })*|)\)/ni
-
FLAG_PERM =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 220Regexp.union(FLAG, "\\*")
-
FLAG_PERM_LIST =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 231/\G\((#{FLAG_PERM}(?:#{SP}#{FLAG_PERM})*|)\)/ni
-
LIST_WILDCARDS =
Internal use only
list-wildcards = “%” / “*”
/[%*]/n
-
LITERAL =
Internal use only
RFC3501:
literal = "{" number "}" CRLF *CHAR8 ; Number represents the number of CHAR8s
RFC9051:
literal = "{" number64 ["+"] "}" CRLF *CHAR8 ; <number64> represents the number of CHAR8s. ; A non-synchronizing literal is distinguished ; from a synchronizing literal by the presence of ; "+" before the closing "}". ; Non-synchronizing literals are not allowed when ; sent from server to the client.
/\{(\d+)\}\r\n/n
-
LITERAL8 =
Internal use only
/~\{(\d+)\}\r\n/n
-
MBX_FLAG =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 221FLAG_EXTENSION
-
MBX_LIST_FLAGS =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 232/\G (#{MBX_FLAG }(?:#{SP}#{MBX_FLAG })*) /nix
-
NZ_NUMBER =
Internal use only
nz-number = digit-nz *DIGIT
; Non-zero unsigned 32-bit integer ; (0 < n < 4,294,967,296)
/[1-9]\d*/n
-
QUIRKY_FLAG =
Internal use only
Gmail allows SP and “]” in flags.……
Regexp.union(/\\?#{ASTRING_CHARS}/n, "\\*")
-
QUIRKY_FLAGS_LIST =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 236/\G\(( [^)]* )\)/nx
-
QUOTED_CHAR_esc =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 247/\\#{QUOTED_SPECIALS}/n
-
QUOTED_CHAR_rev1 =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 248Regexp.union(QUOTED_CHAR_safe, QUOTED_CHAR_esc)
-
QUOTED_CHAR_rev2 =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 249Regexp.union(QUOTED_CHAR_rev1, UTF8_2, UTF8_3, UTF8_4)
-
QUOTED_CHAR_safe =
Internal use only
TEXT_CHAR - QUOTED_SPECIALS
-
QUOTED_SPECIALS =
Internal use only
quoted-specials = DQUOTE / “"
/["\\]/n
-
QUOTED_rev1 =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 251/"(#{QUOTED_CHAR_rev1}*)"/n
-
QUOTED_rev2 =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 252/"(#{QUOTED_CHAR_rev2}*)"/n
-
RESP_SPECIALS =
Internal use only
resp-specials = “]”
/[\]]/n
-
SEQUENCE_SET =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 318/#{SEQUENCE_SET_ITEM}(?:,#{SEQUENCE_SET_ITEM})*/n
-
SEQUENCE_SET_ITEM =
Internal use only
sequence-set = (seq-number / seq-range) [“,” sequence-set]
; set of seq-number values, regardless of order. ; Servers MAY coalesce overlaps and/or execute ; the sequence in any order. ; Example: a message sequence number set of ; 2,4:7,9,12:* for a mailbox with 15 messages is ; equivalent to 2,4,5,6,7,9,12,13,14,15 ; Example: a message sequence number set of ; *:4,5:7 for a mailbox with 10 messages is ; equivalent to 10,9,8,7,6,5,4,5,6,7 and MAY ; be reordered and overlap coalesced to be ; 4,5,6,7,8,9,10.
/#{SEQ_NUMBER}|#{SEQ_RANGE}/n
-
SEQUENCE_SET_STR =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 319/\A#{SEQUENCE_SET}\z/n
-
SEQ_NUMBER =
Internal use only
seq-number = nz-number / “*”
; sequence number (COPY, FETCH, STORE ; commands) or unique identifier (UID COPY, ; UID FETCH, UID STORE commands). ; * represents the largest number in use. In ; the case of sequence numbers, it is ; the number of in a non-empty mailbox. ; In the case of unique identifiers, it is the ; unique identifier of the last in the ; mailbox or, if the mailbox is empty, the ; mailbox's current UIDNEXT value. ; The server should respond with a tagged BAD ; response to a command that uses a message ; sequence number greater than the number of ; messages in the selected mailbox. This ; includes "*" if the selected mailbox is empty.
/#{NZ_NUMBER}|\*/n
-
SEQ_RANGE =
Internal use only
seq-range = seq-number “:” seq-number
; two seq-number values and all values between ; these two regardless of order. ; Example: 2:4 and 4:2 are equivalent and ; indicate values 2, 3, and 4. ; Example: a unique identifier sequence range of ; 3291:* includes the UID of the last in ; the mailbox, even if that value is less than ; 3291.
/#{SEQ_NUMBER}:#{SEQ_NUMBER}/n
-
TAG =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 180/#{ASTRING_CHAR - /[+]/ }+/
-
TAGGED_EXT_LABEL =
Internal use only
tagged-ext-label = tagged-label-fchar *tagged-label-char
; Is a valid RFC 3501 "atom".
/#{TAGGED_LABEL_FCHAR}#{TAGGED_LABEL_CHAR}*/n
-
TAGGED_LABEL_CHAR =
Internal use only
tagged-label-char = tagged-label-fchar / DIGIT / “:”
/[a-zA-Z\-_.0-9:]*/n
-
TAGGED_LABEL_FCHAR =
Internal use only
tagged-label-fchar = ALPHA / “-” / “_” / “.”
/[a-zA-Z\-_.]/n
-
TEXT_CHAR =
Internal use only
TEXT-CHAR = <any CHAR except CR and LF>
CHAR - /[\r\n]/
-
TEXT_rev1 =
Internal use only
/#{TEXT_CHAR}+/
-
TEXT_rev2 =
Internal use only
# File 'lib/net/imap/response_parser.rb', line 261/#{Regexp.union TEXT_CHAR, UTF8_2, UTF8_3, UTF8_4}+/
RFC5234
- Included
ALPHA, CHAR, CRLF, CTL, DIGIT, DQUOTE, HEXDIG, OCTET, SP
RFC3629
- Included
UTF8_1, UTF8_2, UTF8_3, UTF8_4, UTF8_CHAR, UTF8_OCTETS, UTF8_TAIL
Class Method Summary
- .unescape_quoted(quoted) mod_func Internal use only
- .unescape_quoted!(quoted) mod_func Internal use only
Class Method Details
.unescape_quoted(quoted) (mod_func)
# File 'lib/net/imap/response_parser.rb', line 352
def unescape_quoted(quoted) quoted &.gsub(/\\(#{QUOTED_SPECIALS})/n, "\\1") &.force_encoding("UTF-8") end
.unescape_quoted!(quoted) (mod_func)
# File 'lib/net/imap/response_parser.rb', line 346
def unescape_quoted!(quoted) quoted &.gsub!(/\\(#{QUOTED_SPECIALS})/n, "\\1") &.force_encoding("UTF-8") end