@@ -607,6 +607,53 @@ def response_data__simple_numeric
607
607
alias mailbox_data__exists response_data__simple_numeric
608
608
alias mailbox_data__recent response_data__simple_numeric
609
609
610
+ # RFC3501 & RFC9051:
611
+ # msg-att = "(" (msg-att-dynamic / msg-att-static)
612
+ # *(SP (msg-att-dynamic / msg-att-static)) ")"
613
+ #
614
+ # msg-att-dynamic = "FLAGS" SP "(" [flag-fetch *(SP flag-fetch)] ")"
615
+ # RFC5257 (ANNOTATE extension):
616
+ # msg-att-dynamic =/ "ANNOTATION" SP
617
+ # ( "(" entry-att *(SP entry-att) ")" /
618
+ # "(" entry *(SP entry) ")" )
619
+ # RFC7162 (CONDSTORE extension):
620
+ # msg-att-dynamic =/ fetch-mod-resp
621
+ # fetch-mod-resp = "MODSEQ" SP "(" permsg-modsequence ")"
622
+ # RFC8970 (PREVIEW extension):
623
+ # msg-att-dynamic =/ "PREVIEW" SP nstring
624
+ #
625
+ # RFC3501:
626
+ # msg-att-static = "ENVELOPE" SP envelope /
627
+ # "INTERNALDATE" SP date-time /
628
+ # "RFC822" [".HEADER" / ".TEXT"] SP nstring /
629
+ # "RFC822.SIZE" SP number /
630
+ # "BODY" ["STRUCTURE"] SP body /
631
+ # "BODY" section ["<" number ">"] SP nstring /
632
+ # "UID" SP uniqueid
633
+ # RFC3516 (BINARY extension):
634
+ # msg-att-static =/ "BINARY" section-binary SP (nstring / literal8)
635
+ # / "BINARY.SIZE" section-binary SP number
636
+ # RFC8514 (SAVEDATE extension):
637
+ # msg-att-static =/ "SAVEDATE" SP (date-time / nil)
638
+ # RFC8474 (OBJECTID extension):
639
+ # msg-att-static =/ fetch-emailid-resp / fetch-threadid-resp
640
+ # fetch-emailid-resp = "EMAILID" SP "(" objectid ")"
641
+ # fetch-threadid-resp = "THREADID" SP ( "(" objectid ")" / nil )
642
+ # RFC9051:
643
+ # msg-att-static = "ENVELOPE" SP envelope /
644
+ # "INTERNALDATE" SP date-time /
645
+ # "RFC822.SIZE" SP number64 /
646
+ # "BODY" ["STRUCTURE"] SP body /
647
+ # "BODY" section ["<" number ">"] SP nstring /
648
+ # "BINARY" section-binary SP (nstring / literal8) /
649
+ # "BINARY.SIZE" section-binary SP number /
650
+ # "UID" SP uniqueid
651
+ #
652
+ # Re https://www.rfc-editor.org/errata/eid7246, I'm adding "offset" to the
653
+ # official "BINARY" ABNF, like so:
654
+ #
655
+ # msg-att-static =/ "BINARY" section-binary ["<" number ">"] SP
656
+ # (nstring / literal8)
610
657
def msg_att ( n )
611
658
match ( T_LPAR )
612
659
attr = { }
@@ -996,6 +1043,23 @@ def body_extension
996
1043
end
997
1044
end
998
1045
1046
+ # section = "[" [section-spec] "]"
1047
+ #
1048
+ # section-spec = section-msgtext / (section-part ["." section-text])
1049
+ # section-msgtext = "HEADER" /
1050
+ # "HEADER.FIELDS" [".NOT"] SP header-list /
1051
+ # "TEXT"
1052
+ # ; top-level or MESSAGE/RFC822 or
1053
+ # ; MESSAGE/GLOBAL part
1054
+ # section-part = nz-number *("." nz-number)
1055
+ # ; body part reference.
1056
+ # ; Allows for accessing nested body parts.
1057
+ # section-text = section-msgtext / "MIME"
1058
+ # ; text other than actual body part (headers,
1059
+ # ; etc.)
1060
+ #
1061
+ # header-list = "(" header-fld-name *(SP header-fld-name) ")"
1062
+ #
999
1063
def section
1000
1064
str = String . new
1001
1065
token = match ( T_LBRA )
@@ -1031,6 +1095,14 @@ def section
1031
1095
return str
1032
1096
end
1033
1097
1098
+ # header-fld-name = astring
1099
+ #
1100
+ # RFC5233:
1101
+ # optional-field = field-name ":" unstructured CRLF
1102
+ # field-name = 1*ftext
1103
+ # ftext = %d33-57 / ; Printable US-ASCII
1104
+ # %d59-126 ; characters not including
1105
+ # ; ":".
1034
1106
def format_string ( str )
1035
1107
case str
1036
1108
when ""
0 commit comments