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 181CHAR - ASTRING_SPECIALS 
- 
    ASTRING_CHARS =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 185/#{ASTRING_CHAR}+/n
- 
    ASTRING_SPECIALS =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 179/[(){ \x00-\x1f\x7f%*"\\]/n
- 
    ATOM =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 184/#{ATOM_CHAR}+/n
- 
    ATOMISH =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 186/#{ATOM_CHAR - /[\[]/ }+/
- 
    ATOM_CHAR =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 182CHAR - ATOM_SPECIALS 
- 
    ATOM_SPECIALS =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 178atomish = 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-specialsATOM-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
    # File 'lib/net/imap/response_parser.rb', line 158CHAR8= %x01-ff; any OCTET except NUL, %x00/[\x01-\xff]/n
- 
    CODE_TEXT =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 194/#{CODE_TEXT_CHAR}+/n
- 
    CODE_TEXT_CHAR =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 193resp-text-code = … / atom [SP 1*<any TEXT-CHAR except “]”>] TEXT_CHAR - RESP_SPECIALS 
- 
    FLAG =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 224flag = “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" / atomflag-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 responsembx-list-sflag = “NonExistent” / “Noselect” / “Marked” / "\Unmarked" ; Selectability flags; only one per LIST responsechild-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 225/\\#{ATOM}/n
- 
    FLAG_KEYWORD =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 226ATOM
- 
    FLAG_LIST =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 237/\G\((#{FLAG }(?:#{SP}#{FLAG })*|)\)/ni
- 
    FLAG_PERM =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 227Regexp.union(FLAG, "\\*") 
- 
    FLAG_PERM_LIST =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 238/\G\((#{FLAG_PERM}(?:#{SP}#{FLAG_PERM})*|)\)/ni
- 
    LIST_WILDCARDS =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 161list-wildcards = “%” / “*” /[%*]/n
- 
    LITERAL =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 357RFC3501: literal = "{" number "}" CRLF *CHAR8 ; Number represents the number of CHAR8sRFC9051: 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
    # File 'lib/net/imap/response_parser.rb', line 367/~\{(\d+)\}\r\n/n
- 
    MBX_FLAG =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 228FLAG_EXTENSION
- 
    MBX_LIST_FLAGS =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 239/\G (#{MBX_FLAG }(?:#{SP}#{MBX_FLAG })*) /nix
- 
    NZ_NUMBER =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 281nz-number = digit-nz *DIGIT ; Non-zero unsigned 32-bit integer ; (0 < n < 4,294,967,296)/[1-9]\d*/n
- 
    PARTIAL_RANGE =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 343partial-range = partial-range-first / partial-range-last Regexp.union(PARTIAL_RANGE_FIRST, PARTIAL_RANGE_LAST) 
- 
    PARTIAL_RANGE_FIRST =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 334partial-range-first = nz-number “:” nz-number ;; Request to search from oldest (lowest UIDs) to ;; more recent . ;; A range 500:400 is the same as 400:500. ;; This is similar to <seq-range> from [RFC3501] ;; but cannot contain "*"./\A(#{NZ_NUMBER}):(#{NZ_NUMBER})\z/n
- 
    PARTIAL_RANGE_LAST =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 340partial-range-last = MINUS nz-number “:” MINUS nz-number ;; Request to search from newest (highest UIDs) to ;; oldest . ;; A range -500:-400 is the same as -400:-500./\A(-#{NZ_NUMBER}):(-#{NZ_NUMBER})\z/n
- 
    QUIRKY_FLAG =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 242Gmail allows SP and “]” in flags.…… Regexp.union(/\\?#{ASTRING_CHARS}/n, "\\*") 
- 
    QUIRKY_FLAGS_LIST =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 243/\G\(( [^)]* )\)/nx
- 
    QUOTED_CHAR_esc =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 254/\\#{QUOTED_SPECIALS}/n
- 
    QUOTED_CHAR_rev1 =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 255Regexp.union(QUOTED_CHAR_safe, QUOTED_CHAR_esc) 
- 
    QUOTED_CHAR_rev2 =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 256Regexp.union(QUOTED_CHAR_rev1, UTF8_2, UTF8_3, UTF8_4) 
- 
    QUOTED_CHAR_safe =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 253TEXT_CHAR - QUOTED_SPECIALS 
- 
    QUOTED_SPECIALS =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 163quoted-specials = DQUOTE / “" /["\\]/n
- 
    QUOTED_rev1 =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 258/"(#{QUOTED_CHAR_rev1}*)"/n
- 
    QUOTED_rev2 =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 259/"(#{QUOTED_CHAR_rev2}*)"/n
- 
    RESP_SPECIALS =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 165resp-specials = “]” /[\]]/n
- 
    SEQUENCE_SET =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 325/#{SEQUENCE_SET_ITEM}(?:,#{SEQUENCE_SET_ITEM})*/n
- 
    SEQUENCE_SET_ITEM =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 324sequence-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 326/\A#{SEQUENCE_SET}\z/n
- 
    SEQ_NUMBER =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 299seq-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
    # File 'lib/net/imap/response_parser.rb', line 310seq-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 187/#{ASTRING_CHAR - /[+]/ }+/
- 
    TAGGED_EXT_LABEL =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 276tagged-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
    # File 'lib/net/imap/response_parser.rb', line 273tagged-label-char = tagged-label-fchar / DIGIT / “:” /[a-zA-Z\-_.0-9:]*/n
- 
    TAGGED_LABEL_FCHAR =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 271tagged-label-fchar = ALPHA / “-” / “_” / “.” /[a-zA-Z\-_.]/n
- 
    TEXT_CHAR =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 190TEXT-CHAR = <any CHAR except CR and LF> CHAR - /[\r\n]/ 
- 
    TEXT_rev1 =
    Internal use only
    # File 'lib/net/imap/response_parser.rb', line 267/#{TEXT_CHAR}+/
- 
    TEXT_rev2 =
    Internal use only
    
 # File 'lib/net/imap/response_parser.rb', line 268/#{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 377
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 371
def unescape_quoted!(quoted) quoted &.gsub!(/\\(#{QUOTED_SPECIALS})/n, "\\1") &.force_encoding("UTF-8") end