imap4d: Fix the functionality of FETCH BODY sections HEADER, TEXT and MIME.
According to RFC 3501 HEADER, HEADER.FIELDS, and HEADER.FIELDS.NOT part specifiers refer to the RFC-2822 header of the message or of an encapsulated MESSAGE/RFC822 message. They return NILs if applied to a MIME part other than MESSAGE/RFC822. * imap4d/fetch.c (fetch_get_part_rfc822): New function. (_frt_body): Used only for BODY[]. Consequently, do not try to resolve message part, use the message itself instead. (_frt_body_n): New function. (_frt_mime): New function. (_frt_body_text,_frt_header,_frt_header_fields): Use fetch_get_part_rfc822. Unref the retrieved message when through. (parse_section_text): Use _frt_mime for BODY[<n>.MIME] (parse_section): Use _frt_body_n for BODY[<n>]. * imap4d/testsuite/imap4d/fetch.exp: Remove incorrect tests.
Showing
2 changed files
with
133 additions
and
71 deletions
-
Please register or sign in to post a comment