Skip to content

Commit

Permalink
jmap_mail: rewrite JMAP Email to MIME conversion
Browse files Browse the repository at this point in the history
This updates how MIME messages are created from JMAP Email objects
for Email/set{create}. Changes include:

- Inline plain text is rewritten before conversion regardless
  if its content is sourced from an EmailBodyValue or Blob.
  Non-plain text content now never is rewritten, even if it is
  defined with in a EmailBodyValue.
- If the charset property for inline plain text declares the
  content to be ASCII or UTF-8, then the EmailBodyPart is
  rejected for invalid characters.
- The content transfer encoding for "message" media types is
  chosen by the media subtype, e.g. handling "message/rfc822"
  and "message/global" differently.
- Bare carriage returns in inline plain text now get expanded
  to CRLF, rather than omitted from the body part contents.
- Transfer encoding names are written in lowercase, e.g. "8bit"
  rather than "8BIT".
  • Loading branch information
rsto committed May 3, 2024
1 parent e515ec5 commit b886660
Show file tree
Hide file tree
Showing 6 changed files with 1,284 additions and 313 deletions.
2 changes: 1 addition & 1 deletion cassandane/tiny-tests/JMAPEmail/email_set_blobencoding
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ EOF
my $gotPart;
$gotPart = $res->[1][1]{list}[0]{bodyStructure}{subParts}[1];
$self->assert_str_equals('message/rfc822', $gotPart->{type});
$self->assert_str_equals(' 7BIT', $gotPart->{'header:Content-Transfer-Encoding'});
$self->assert_str_equals(' 7bit', $gotPart->{'header:Content-Transfer-Encoding'});
$gotPart = $res->[1][1]{list}[0]{bodyStructure}{subParts}[2];
$self->assert_str_equals('image/gif', $gotPart->{type});
$self->assert_str_equals(' BASE64', uc($gotPart->{'header:Content-Transfer-Encoding'}));
Expand Down
Loading

0 comments on commit b886660

Please sign in to comment.