API change, #1: _mime_encode_message_internal is now gone. mime_encode_message has 4th argument indicating that the first attachment is an embedded pEp message and it should be processed accordingly. postrelease
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Fri, 24 Apr 2020 18:37:29 +0200
branchpostrelease
changeset 4591fbaa9d61a265
parent 4590 448f18d446de
child 4592 f0e7ec9616c5
API change, #1: _mime_encode_message_internal is now gone. mime_encode_message has 4th argument indicating that the first attachment is an embedded pEp message and it should be processed accordingly.
src/aux_mime_msg.c
src/etpan_mime.c
src/message_api.c
src/mime.c
src/mime.h
test/src/DecorateTest.cc
test/src/EmptyLongmsgFullHtmlTest.cc
test/src/EncryptAttachPrivateKeyTest.cc
test/src/EncryptForIdentityTest.cc
test/src/Engine514Test.cc
test/src/KeyResetMessageTest.cc
test/src/MessageApiTest.cc
test/src/MessageTwoPointOhTest.cc
test/src/MimeTest.cc
test/src/SenderFPRTest.cc
test/src/UnencryptedPepMailTest.cc
test/src/test_util.cc
     1.1 --- a/src/aux_mime_msg.c	Fri Apr 24 17:28:29 2020 +0200
     1.2 +++ b/src/aux_mime_msg.c	Fri Apr 24 18:37:29 2020 +0200
     1.3 @@ -120,7 +120,7 @@
     1.4      }
     1.5  
     1.6      if (*flags & PEP_decrypt_flag_src_modified) {
     1.7 -        _mime_encode_message_internal(tmp_msg, false, modified_src, false);
     1.8 +        mime_encode_message(tmp_msg, false, modified_src, false);
     1.9          if (!modified_src) {
    1.10              *flags &= (~PEP_decrypt_flag_src_modified);
    1.11              decrypt_status = PEP_CANNOT_REENCRYPT; // Because we couldn't return it, I guess.
    1.12 @@ -128,7 +128,7 @@
    1.13      }
    1.14  
    1.15      // FIXME: test with att
    1.16 -    status = _mime_encode_message_internal(dec_msg, false, mime_plaintext, false);
    1.17 +    status = mime_encode_message(dec_msg, false, mime_plaintext, false);
    1.18  
    1.19      if (status == PEP_STATUS_OK)
    1.20      {
    1.21 @@ -217,11 +217,10 @@
    1.22          goto pEp_error;
    1.23      }
    1.24      
    1.25 -    tmp_status = _mime_encode_message_internal(
    1.26 -                                ret_msg, 
    1.27 -                                false, 
    1.28 -                                mime_ciphertext, 
    1.29 -                                false);
    1.30 +    tmp_status = mime_encode_message(ret_msg, 
    1.31 +                                     false, 
    1.32 +                                     mime_ciphertext, 
    1.33 +                                     false);
    1.34      
    1.35      if (tmp_status != PEP_STATUS_OK)
    1.36          status = tmp_status;
    1.37 @@ -270,7 +269,7 @@
    1.38          goto pEp_error;
    1.39      }
    1.40  
    1.41 -    status = mime_encode_message(enc_msg, false, mime_ciphertext);
    1.42 +    status = mime_encode_message(enc_msg, false, mime_ciphertext, false);
    1.43  
    1.44  pEp_error:
    1.45      free_message(tmp_msg);
     2.1 --- a/src/etpan_mime.c	Fri Apr 24 17:28:29 2020 +0200
     2.2 +++ b/src/etpan_mime.c	Fri Apr 24 18:37:29 2020 +0200
     2.3 @@ -1746,7 +1746,7 @@
     2.4          const message *msg,
     2.5          bool omit_fields,
     2.6          struct mailmime **result,
     2.7 -        bool contains_non_fwd_msg_att
     2.8 +        bool has_pEp_msg_attachment
     2.9      )
    2.10  {
    2.11      struct mailmime * mime = NULL;
    2.12 @@ -1859,7 +1859,7 @@
    2.13                  continue;
    2.14  
    2.15              // solely for readability.
    2.16 -            bool is_pEp_msg_attachment = (first_one && contains_non_fwd_msg_att);
    2.17 +            bool is_pEp_msg_attachment = (first_one && has_pEp_msg_attachment);
    2.18  
    2.19              status = mime_attachment(_a, &submime, 
    2.20                                       is_pEp_msg_attachment);                         
    2.21 @@ -1975,11 +1975,11 @@
    2.22      return status;
    2.23  }
    2.24  
    2.25 -PEP_STATUS _mime_encode_message_internal(
    2.26 +DYNAMIC_API PEP_STATUS mime_encode_message(
    2.27          const message * msg,
    2.28          bool omit_fields,
    2.29          char **mimetext,
    2.30 -        bool set_attachment_forward_comment
    2.31 +        bool has_pEp_msg_attachment
    2.32      )
    2.33  {
    2.34      PEP_STATUS status = PEP_STATUS_OK;
    2.35 @@ -1999,10 +1999,10 @@
    2.36  
    2.37      switch (msg->enc_format) {
    2.38          case PEP_enc_none:
    2.39 -            status = mime_encode_message_plain(msg, omit_fields, &mime, set_attachment_forward_comment);
    2.40 +            status = mime_encode_message_plain(msg, omit_fields, &mime, has_pEp_msg_attachment);
    2.41              break;
    2.42  
    2.43 -        // I'm presuming we should hardcore ignoring set_attachment_forward_comment here...
    2.44 +        // I'm presuming we should hardcore ignoring has_pEp_msg_attachment here...
    2.45          case PEP_enc_inline:
    2.46              status = mime_encode_message_plain(msg, omit_fields, &mime, false);
    2.47              break;
     3.1 --- a/src/message_api.c	Fri Apr 24 17:28:29 2020 +0200
     3.2 +++ b/src/message_api.c	Fri Apr 24 18:37:29 2020 +0200
     3.3 @@ -921,7 +921,7 @@
     3.4                );
     3.5              
     3.6      /* Turn message into a MIME-blob */
     3.7 -    status = _mime_encode_message_internal(attachment, false, &message_text, false);
     3.8 +    status = mime_encode_message(attachment, false, &message_text, false);
     3.9          
    3.10      if (status != PEP_STATUS_OK)
    3.11          goto enomem;
    3.12 @@ -1028,7 +1028,7 @@
    3.13      _src->enc_format = PEP_enc_none;
    3.14      
    3.15      bool wrapped = (wrap_type != PEP_message_unwrapped);
    3.16 -    status = _mime_encode_message_internal(_src, true, &mimetext, wrapped);
    3.17 +    status = mime_encode_message(_src, true, &mimetext, wrapped);
    3.18      assert(status == PEP_STATUS_OK);
    3.19      if (status != PEP_STATUS_OK)
    3.20          goto pEp_error;
     4.1 --- a/src/mime.c	Fri Apr 24 17:28:29 2020 +0200
     4.2 +++ b/src/mime.c	Fri Apr 24 18:37:29 2020 +0200
     4.3 @@ -32,12 +32,3 @@
     4.4  
     4.5      return strncmp(text, "-----BEGIN PGP MESSAGE-----", 27) == 0;
     4.6  }
     4.7 -
     4.8 -DYNAMIC_API PEP_STATUS mime_encode_message(
     4.9 -        const message * msg,
    4.10 -        bool omit_fields,
    4.11 -        char **mimetext
    4.12 -    )
    4.13 -{
    4.14 -    return _mime_encode_message_internal(msg, omit_fields, mimetext, false);
    4.15 -}
     5.1 --- a/src/mime.h	Fri Apr 24 17:28:29 2020 +0200
     5.2 +++ b/src/mime.h	Fri Apr 24 18:37:29 2020 +0200
     5.3 @@ -23,9 +23,21 @@
     5.4  // mime_encode_message() - encode a MIME message
     5.5  //
     5.6  //  parameters:
     5.7 -//      msg (in)                message to encode
     5.8 -//      omit_fields (in)        only encode message body and attachments
     5.9 -//      mimetext (out)          the resulting encoded text or NULL on any error
    5.10 +//      msg (in)                       message to encode
    5.11 +//      omit_fields (in)               only encode message body and 
    5.12 +//                                     attachments
    5.13 +//      mimetext (out)                 the resulting encoded text or 
    5.14 +//                                     NULL on any error
    5.15 +//      has_pEp_msg_attachment (in)    is the first *attachment* to this 
    5.16 +//                                     message an embedded pEp message
    5.17 +//                                     which needs appropriate marking
    5.18 +//                                     (forwarded=no, etc) and encoding?
    5.19 +//                                     (this argument is internal to 
    5.20 +//                                     pEp and should almost
    5.21 +//                                     ALWAYS be false when used 
    5.22 +//                                     by external callers, including
    5.23 +//                                     adapters!!!)
    5.24 +//                                  
    5.25  //
    5.26  //  return value:
    5.27  //      PEP_STATUS_OK           if everything worked
    5.28 @@ -48,7 +60,8 @@
    5.29  DYNAMIC_API PEP_STATUS mime_encode_message(
    5.30          const message * msg,
    5.31          bool omit_fields,
    5.32 -        char **mimetext
    5.33 +        char **mimetext,
    5.34 +        bool has_pEp_msg_attachment     
    5.35      );
    5.36  
    5.37  
    5.38 @@ -86,15 +99,6 @@
    5.39          bool* raise_msg_attachment
    5.40      );
    5.41  
    5.42 -/* sometimes we don't want to transport encode */
    5.43 -PEP_STATUS _mime_encode_message_internal(
    5.44 -        const message * msg,
    5.45 -        bool omit_fields,
    5.46 -        char **mimetext,
    5.47 -        bool set_attachment_forward_comment        
    5.48 -    );
    5.49 -
    5.50 -
    5.51  #ifdef __cplusplus
    5.52  }
    5.53  #endif
     6.1 --- a/test/src/DecorateTest.cc	Fri Apr 24 17:28:29 2020 +0200
     6.2 +++ b/test/src/DecorateTest.cc	Fri Apr 24 18:37:29 2020 +0200
     6.3 @@ -129,7 +129,7 @@
     6.4      ASSERT_NE(encrypted_msg, nullptr);
     6.5      output_stream << "message encrypted.\n";
     6.6  
     6.7 -    status = mime_encode_message(encrypted_msg, false, &encoded_text);
     6.8 +    status = mime_encode_message(encrypted_msg, false, &encoded_text, false);
     6.9      ASSERT_EQ(status , PEP_STATUS_OK);
    6.10      ASSERT_NE(encoded_text, nullptr);
    6.11  
     7.1 --- a/test/src/EmptyLongmsgFullHtmlTest.cc	Fri Apr 24 17:28:29 2020 +0200
     7.2 +++ b/test/src/EmptyLongmsgFullHtmlTest.cc	Fri Apr 24 18:37:29 2020 +0200
     7.3 @@ -133,7 +133,7 @@
     7.4      msg->shortmsg = strdup("Eat Moar Cheese");
     7.5      
     7.6      char* outmsg = NULL;
     7.7 -    mime_encode_message(msg, false, &outmsg);
     7.8 +    mime_encode_message(msg, false, &outmsg, false);
     7.9      
    7.10      cout << outmsg << endl;
    7.11      
    7.12 @@ -157,7 +157,7 @@
    7.13      msg->attachments = new_bloblist(text_att, strlen(text_att), "text/plain", NULL);
    7.14      
    7.15      char* outmsg = NULL;
    7.16 -    mime_encode_message(msg, false, &outmsg);
    7.17 +    mime_encode_message(msg, false, &outmsg, false);
    7.18      
    7.19      ASSERT_EQ(strstr(outmsg, "alternative"), nullptr);
    7.20      
    7.21 @@ -183,7 +183,7 @@
    7.22      msg->attachments = new_bloblist(text_att, strlen(text_att), "text/plain", NULL);
    7.23      
    7.24      char* outmsg = NULL;
    7.25 -    mime_encode_message(msg, false, &outmsg);
    7.26 +    mime_encode_message(msg, false, &outmsg, false);
    7.27      
    7.28      ASSERT_EQ(strstr(outmsg, "alternative"), nullptr);
    7.29      ASSERT_EQ(strstr(outmsg, "related"), nullptr);
    7.30 @@ -213,7 +213,7 @@
    7.31      bloblist_add(msg->attachments, html_att, strlen(html_att), "text/html", "stupid_msg.html");
    7.32  
    7.33      char* outmsg = NULL;
    7.34 -    mime_encode_message(msg, false, &outmsg);
    7.35 +    mime_encode_message(msg, false, &outmsg, false);
    7.36      
    7.37      // Could do more here, but honestly, these are just sanity checks, as mostly this is getting checked by inspection
    7.38      ASSERT_EQ(strstr(outmsg, "alternative"), nullptr);
    7.39 @@ -255,7 +255,7 @@
    7.40      msg->attachments->next = new_bloblist(text_att, strlen(text_att), "text/plain", "blargh.txt");
    7.41      
    7.42      char* outmsg = NULL;
    7.43 -    mime_encode_message(msg, false, &outmsg);
    7.44 +    mime_encode_message(msg, false, &outmsg, false);
    7.45      
    7.46      cout << outmsg << endl;
    7.47          
    7.48 @@ -293,7 +293,7 @@
    7.49      msg->longmsg = strdup("");
    7.50          
    7.51      char* outmsg = NULL;
    7.52 -    mime_encode_message(msg, false, &outmsg);
    7.53 +    mime_encode_message(msg, false, &outmsg, false);
    7.54          
    7.55      cout << outmsg << endl;
    7.56      
    7.57 @@ -338,7 +338,7 @@
    7.58      msg->attachments = new_bloblist(img, img_size, "image/jpeg", "cid://part1.21156198.7E41C8BF@darthmama.org");
    7.59          
    7.60      char* outmsg = NULL;
    7.61 -    mime_encode_message(msg, false, &outmsg);
    7.62 +    mime_encode_message(msg, false, &outmsg, false);
    7.63          
    7.64      ASSERT_EQ(strstr(outmsg, "alternative"), nullptr);
    7.65      ASSERT_NE(strstr(outmsg, "related"), nullptr);
    7.66 @@ -388,7 +388,7 @@
    7.67      bloblist_add(msg->attachments, img, img_size, "image/jpeg", "meow.jpg");
    7.68          
    7.69      char* outmsg = NULL;
    7.70 -    mime_encode_message(msg, false, &outmsg);
    7.71 +    mime_encode_message(msg, false, &outmsg, false);
    7.72          
    7.73      ASSERT_EQ(strstr(outmsg, "alternative"), nullptr);
    7.74      ASSERT_NE(strstr(outmsg, "related"), nullptr);
     8.1 --- a/test/src/EncryptAttachPrivateKeyTest.cc	Fri Apr 24 17:28:29 2020 +0200
     8.2 +++ b/test/src/EncryptAttachPrivateKeyTest.cc	Fri Apr 24 18:37:29 2020 +0200
     8.3 @@ -346,7 +346,7 @@
     8.4  
     8.5      output_stream << "Correctly encrypted message:" << endl << endl;
     8.6      char* encrypted_msg_text = NULL;
     8.7 -    mime_encode_message(enc_same_addr_same_uid_trusted, false, &encrypted_msg_text);
     8.8 +    mime_encode_message(enc_same_addr_same_uid_trusted, false, &encrypted_msg_text, false);
     8.9      output_stream << encrypted_msg_text << endl << endl;
    8.10  
    8.11      // FIXME: Free all the damned things
     9.1 --- a/test/src/EncryptForIdentityTest.cc	Fri Apr 24 17:28:29 2020 +0200
     9.2 +++ b/test/src/EncryptForIdentityTest.cc	Fri Apr 24 18:37:29 2020 +0200
     9.3 @@ -133,7 +133,7 @@
     9.4      output_stream << "message created.\n";
     9.5  
     9.6      char* encoded_text = nullptr;
     9.7 -    PEP_STATUS status = mime_encode_message(outgoing_message, false, &encoded_text);
     9.8 +    PEP_STATUS status = mime_encode_message(outgoing_message, false, &encoded_text, false);
     9.9      ASSERT_EQ(status, PEP_STATUS_OK);
    9.10      ASSERT_NE(encoded_text, nullptr);
    9.11  
    9.12 @@ -150,7 +150,7 @@
    9.13      ASSERT_NE(encrypted_msg, nullptr);
    9.14      output_stream << "message encrypted.\n";
    9.15  
    9.16 -    status = mime_encode_message(encrypted_msg, false, &encoded_text);
    9.17 +    status = mime_encode_message(encrypted_msg, false, &encoded_text, false);
    9.18      ASSERT_EQ(status, PEP_STATUS_OK);
    9.19      ASSERT_NE(encoded_text, nullptr);
    9.20  
    10.1 --- a/test/src/Engine514Test.cc	Fri Apr 24 17:28:29 2020 +0200
    10.2 +++ b/test/src/Engine514Test.cc	Fri Apr 24 18:37:29 2020 +0200
    10.3 @@ -92,7 +92,7 @@
    10.4      not_the_msg->shortmsg = strdup("This is an ATTACHMENT");
    10.5      not_the_msg->longmsg = strdup("Some body text here.");
    10.6  
    10.7 -    mime_encode_message(not_the_msg, false, &attachment_text);
    10.8 +    mime_encode_message(not_the_msg, false, &attachment_text, false);
    10.9      ASSERT_NE(attachment_text, nullptr);
   10.10      free_message(not_the_msg);
   10.11          
   10.12 @@ -120,7 +120,7 @@
   10.13      
   10.14      // Funny, it's not reproduceable here.
   10.15      char* output_str = NULL;
   10.16 -    mime_encode_message(msg, false, &output_str);
   10.17 +    mime_encode_message(msg, false, &output_str, false);
   10.18      char* find_the_mimetype = strstr(output_str, "message/rfc822");
   10.19      ASSERT_NE(find_the_mimetype, nullptr);
   10.20      find_the_mimetype = strstr(output_str, "text/rfc822");
   10.21 @@ -143,7 +143,7 @@
   10.22      not_the_msg->shortmsg = strdup("This is an ATTACHMENT");
   10.23      not_the_msg->longmsg = strdup("Some body text here.");
   10.24  
   10.25 -    mime_encode_message(not_the_msg, false, &attachment_text);
   10.26 +    mime_encode_message(not_the_msg, false, &attachment_text, false);
   10.27      ASSERT_NE(attachment_text, nullptr);
   10.28      free_message(not_the_msg);
   10.29          
   10.30 @@ -173,7 +173,7 @@
   10.31      
   10.32      // Still not reproduceable
   10.33      char* output_str = NULL;
   10.34 -    mime_encode_message(msg, false, &output_str);
   10.35 +    mime_encode_message(msg, false, &output_str, false);
   10.36      cout << output_str << endl;
   10.37      char* find_the_mimetype = strstr(output_str, "message/rfc822");
   10.38      ASSERT_NE(find_the_mimetype, nullptr);
   10.39 @@ -192,7 +192,7 @@
   10.40      not_the_msg->shortmsg = strdup("This is an ATTACHMENT");
   10.41      not_the_msg->longmsg = strdup("Some body text here.");
   10.42  
   10.43 -    mime_encode_message(not_the_msg, false, &attachment_text);
   10.44 +    mime_encode_message(not_the_msg, false, &attachment_text, false);
   10.45      ASSERT_NE(attachment_text, nullptr);
   10.46      free_message(not_the_msg);
   10.47          
   10.48 @@ -213,7 +213,7 @@
   10.49      msg->attachments = new_bloblist(attachment_text, strlen(attachment_text), "message/rfc822", NULL); 
   10.50      
   10.51      char* output_str = NULL;
   10.52 -    mime_encode_message(msg, false, &output_str);
   10.53 +    mime_encode_message(msg, false, &output_str, false);
   10.54      cout << output_str << endl;
   10.55      char* find_the_mimetype = strstr(output_str, "message/rfc822");
   10.56      ASSERT_NE(find_the_mimetype, nullptr);
   10.57 @@ -239,7 +239,7 @@
   10.58      not_the_msg->shortmsg = strdup("This is an ATTACHMENT");
   10.59      not_the_msg->longmsg = strdup("Some body text here.");
   10.60  
   10.61 -    mime_encode_message(not_the_msg, false, &attachment_text);
   10.62 +    mime_encode_message(not_the_msg, false, &attachment_text, false);
   10.63      ASSERT_NE(attachment_text, nullptr);
   10.64      free_message(not_the_msg);
   10.65          
   10.66 @@ -276,7 +276,7 @@
   10.67      
   10.68      // Funny, it's not reproduceable here.
   10.69      // char* output_str = NULL;
   10.70 -    // mime_encode_message(msg, false, &output_str);
   10.71 +    // mime_encode_message(msg, false, &output_str, false);
   10.72      // char* find_the_mimetype = strstr(output_str, "message/rfc822");
   10.73      // ASSERT_NE(find_the_mimetype, nullptr);
   10.74      // find_the_mimetype = strstr(output_str, "text/rfc822");
    11.1 --- a/test/src/KeyResetMessageTest.cc	Fri Apr 24 17:28:29 2020 +0200
    11.2 +++ b/test/src/KeyResetMessageTest.cc	Fri Apr 24 18:37:29 2020 +0200
    11.3 @@ -217,7 +217,7 @@
    11.4              ASSERT_NE(enc_outgoing_msg, nullptr);
    11.5              output_stream << "Message encrypted.\n";
    11.6              char* outstring = NULL;
    11.7 -            mime_encode_message(enc_outgoing_msg, false, &outstring);
    11.8 +            mime_encode_message(enc_outgoing_msg, false, &outstring, false);
    11.9              output_stream << outstring << endl;
   11.10              free_message(enc_outgoing_msg);
   11.11              free(outstring);
   11.12 @@ -350,7 +350,7 @@
   11.13                  ofstream outfile;
   11.14                  outfile.open("test_files/398_reset_from_alice_to_bob.eml");
   11.15                  char* bob_msg = NULL;
   11.16 -                mime_encode_message(curr_sent_msg, false, &bob_msg);
   11.17 +                mime_encode_message(curr_sent_msg, false, &bob_msg, false);
   11.18                  outfile << bob_msg;
   11.19                  outfile.close();
   11.20              }
   11.21 @@ -358,7 +358,7 @@
   11.22                  ofstream outfile;
   11.23                  outfile.open("test_files/398_reset_from_alice_to_fenris.eml");
   11.24                  char* fenris_msg = NULL;
   11.25 -                mime_encode_message(curr_sent_msg, false, &fenris_msg);
   11.26 +                mime_encode_message(curr_sent_msg, false, &fenris_msg, false);
   11.27                  outfile << fenris_msg;
   11.28                  outfile.close();
   11.29              }
   11.30 @@ -656,7 +656,7 @@
   11.31          outfile.open("test_mails/check_reset_grouped_own_recv.eml");
   11.32          message* curr_sent_msg = m_queue.at(0);
   11.33          char* msg_txt = NULL;
   11.34 -        mime_encode_message(curr_sent_msg, false, &msg_txt);
   11.35 +        mime_encode_message(curr_sent_msg, false, &msg_txt, false);
   11.36          outfile << msg_txt;
   11.37          outfile.close();
   11.38          cout << "    ASSERT_STREQ(alice->fpr, \"" << alice_new_fpr << "\");" << endl;
   11.39 @@ -814,7 +814,7 @@
   11.40          string fname = "test_mails/check_reset_grouped_own_multi_ident_one_fpr.eml";
   11.41          outfile.open(fname);
   11.42          char* msg_txt = NULL;
   11.43 -        mime_encode_message(curr_sent_msg, false, &msg_txt);
   11.44 +        mime_encode_message(curr_sent_msg, false, &msg_txt, false);
   11.45          outfile << msg_txt;
   11.46          outfile.close();        
   11.47          cout <<  "    // check_reset_grouped_own_multi_ident_one_fpr_recv" << endl;
   11.48 @@ -1032,7 +1032,7 @@
   11.49              string fname = string("test_mails/check_reset_grouped_own_multiple_keys_multiple_idents_reset_all_") + to_string(i) + ".eml";
   11.50              outfile.open(fname);
   11.51              char* msg_txt = NULL;
   11.52 -            mime_encode_message(curr_sent_msg, false, &msg_txt);
   11.53 +            mime_encode_message(curr_sent_msg, false, &msg_txt, false);
   11.54              outfile << msg_txt;
   11.55              outfile.close();        
   11.56          }
   11.57 @@ -1161,7 +1161,7 @@
   11.58              string fname = string("test_mails/check_reset_all_own_grouped") + to_string(i) + ".eml";
   11.59              outfile.open(fname);
   11.60              char* msg_txt = NULL;
   11.61 -            mime_encode_message(curr_sent_msg, false, &msg_txt);
   11.62 +            mime_encode_message(curr_sent_msg, false, &msg_txt, false);
   11.63              outfile << msg_txt;
   11.64              outfile.close();        
   11.65          }
   11.66 @@ -1495,7 +1495,7 @@
   11.67          string fname = "test_mails/check_reset_grouped_own_multiple_keys_multiple_idents_reset_one.eml";
   11.68          outfile.open(fname);
   11.69          char* msg_txt = NULL;
   11.70 -        mime_encode_message(curr_sent_msg, false, &msg_txt);
   11.71 +        mime_encode_message(curr_sent_msg, false, &msg_txt, false);
   11.72          outfile << msg_txt;
   11.73          outfile.close();   
   11.74          cout <<  "    // check_reset_grouped_own_multiple_keys_multiple_idents_reset_one_recv" << endl;  
   11.75 @@ -2320,7 +2320,7 @@
   11.76  
   11.77      status = encrypt_message(session, bob_msg, NULL, &enc_msg, PEP_enc_PGP_MIME, 0);
   11.78      ASSERT_EQ(status, PEP_STATUS_OK);
   11.79 -    status = mime_encode_message(enc_msg, false, &enc_msg_str);
   11.80 +    status = mime_encode_message(enc_msg, false, &enc_msg_str, false);
   11.81  
   11.82      ofstream myfile;
   11.83      myfile.open("test_mails/ENGINE-654_bob_mail.eml");
    12.1 --- a/test/src/MessageApiTest.cc	Fri Apr 24 17:28:29 2020 +0200
    12.2 +++ b/test/src/MessageApiTest.cc	Fri Apr 24 18:37:29 2020 +0200
    12.3 @@ -117,7 +117,7 @@
    12.4      output_stream << "message created.\n";
    12.5  
    12.6      char *text2 = nullptr;
    12.7 -    PEP_STATUS status2 = mime_encode_message(msg2, false, &text2);
    12.8 +    PEP_STATUS status2 = mime_encode_message(msg2, false, &text2, false);
    12.9      ASSERT_EQ(status2 , PEP_STATUS_OK);
   12.10      ASSERT_NE(text2, nullptr);
   12.11  
   12.12 @@ -135,7 +135,7 @@
   12.13      ASSERT_NE(enc_msg2, nullptr);
   12.14      output_stream << "message encrypted.\n";
   12.15  
   12.16 -    status2 = mime_encode_message(enc_msg2, false, &text2);
   12.17 +    status2 = mime_encode_message(enc_msg2, false, &text2, false);
   12.18      ASSERT_EQ(status2 , PEP_STATUS_OK);
   12.19      ASSERT_NE(text2, nullptr);
   12.20  
    13.1 --- a/test/src/MessageTwoPointOhTest.cc	Fri Apr 24 17:28:29 2020 +0200
    13.2 +++ b/test/src/MessageTwoPointOhTest.cc	Fri Apr 24 18:37:29 2020 +0200
    13.3 @@ -142,7 +142,7 @@
    13.4      output_stream << "message created.\n";
    13.5  
    13.6      char* encoded_text = nullptr;
    13.7 -    status = mime_encode_message(outgoing_message, false, &encoded_text);
    13.8 +    status = mime_encode_message(outgoing_message, false, &encoded_text, false);
    13.9      ASSERT_EQ(status , PEP_STATUS_OK);
   13.10      ASSERT_NE(encoded_text, nullptr);
   13.11  
   13.12 @@ -162,7 +162,7 @@
   13.13      output_stream << "message encrypted.\n";
   13.14  
   13.15      encrypted_msg->enc_format = PEP_enc_none;
   13.16 -    status = mime_encode_message(encrypted_msg, false, &encoded_text);
   13.17 +    status = mime_encode_message(encrypted_msg, false, &encoded_text, false);
   13.18      ASSERT_EQ(status , PEP_STATUS_OK);
   13.19      ASSERT_NE(encoded_text, nullptr);
   13.20  
   13.21 @@ -217,7 +217,7 @@
   13.22      }
   13.23  
   13.24      decrypted_msg->enc_format = PEP_enc_none;
   13.25 -    status = _mime_encode_message_internal(decrypted_msg, false, &encoded_text, false);
   13.26 +    status = mime_encode_message(decrypted_msg, false, &encoded_text, false);
   13.27      ASSERT_EQ(status , PEP_STATUS_OK);
   13.28      ASSERT_NE(encoded_text, nullptr);
   13.29      output_stream << "Decrypted message: " << endl;
    14.1 --- a/test/src/MimeTest.cc	Fri Apr 24 17:28:29 2020 +0200
    14.2 +++ b/test/src/MimeTest.cc	Fri Apr 24 18:37:29 2020 +0200
    14.3 @@ -147,7 +147,7 @@
    14.4  
    14.5      output_stream << "encoding message…\n";
    14.6      char *result2;
    14.7 -    PEP_STATUS status2 = mime_encode_message(msg2, false, &result2);
    14.8 +    PEP_STATUS status2 = mime_encode_message(msg2, false, &result2, false);
    14.9      ASSERT_NE(result2, nullptr);
   14.10      ASSERT_EQ(status2, PEP_STATUS_OK);
   14.11  
    15.1 --- a/test/src/SenderFPRTest.cc	Fri Apr 24 17:28:29 2020 +0200
    15.2 +++ b/test/src/SenderFPRTest.cc	Fri Apr 24 18:37:29 2020 +0200
    15.3 @@ -129,7 +129,7 @@
    15.4      ASSERT_EQ(status , PEP_STATUS_OK);
    15.5  
    15.6      char* text = NULL;
    15.7 -    mime_encode_message(dec_msg, false, &text);
    15.8 +    mime_encode_message(dec_msg, false, &text, false);
    15.9      output_stream << text << endl;
   15.10      free(text);
   15.11  
    16.1 --- a/test/src/UnencryptedPepMailTest.cc	Fri Apr 24 17:28:29 2020 +0200
    16.2 +++ b/test/src/UnencryptedPepMailTest.cc	Fri Apr 24 18:37:29 2020 +0200
    16.3 @@ -120,7 +120,7 @@
    16.4      ASSERT_TRUE(is_pEpmsg(msg));
    16.5      
    16.6      // char* outmsg = NULL;
    16.7 -    // mime_encode_message(msg, false, &outmsg);
    16.8 +    // mime_encode_message(msg, false, &outmsg, false);
    16.9      // ofstream outfile;
   16.10      // outfile.open("tmp/unenc_pep_msg_test_1.eml");
   16.11      // outfile << outmsg;
   16.12 @@ -161,7 +161,7 @@
   16.13                            "I do not want a cup of 'Hoffee', and you are not singlehandedly\n" 
   16.14                            "responsible for bringing down the Berlin Wall.\n\nGo away. - Alice");
   16.15      char* outmsg = NULL;
   16.16 -    mime_encode_message(msg, false, &outmsg);
   16.17 +    mime_encode_message(msg, false, &outmsg, false);
   16.18      char* encmsg = NULL;
   16.19          
   16.20      status = MIME_encrypt_message(session, outmsg, strlen(outmsg), NULL, &encmsg, PEP_enc_PGP_MIME, 0);
   16.21 @@ -174,7 +174,7 @@
   16.22      ASSERT_NE(encmsg, nullptr);
   16.23      
   16.24      // char* outmsg = NULL;
   16.25 -    // mime_encode_message(msg, false, &outmsg);
   16.26 +    // mime_encode_message(msg, false, &outmsg, false);
   16.27      // ofstream outfile;
   16.28      // outfile.open("tmp/unenc_pep_msg_test_1.eml");
   16.29      // outfile << outmsg;
    17.1 --- a/test/src/test_util.cc	Fri Apr 24 17:28:29 2020 +0200
    17.2 +++ b/test/src/test_util.cc	Fri Apr 24 18:37:29 2020 +0200
    17.3 @@ -593,7 +593,7 @@
    17.4      }
    17.5  
    17.6      if (*flags & PEP_decrypt_flag_src_modified) {
    17.7 -        _mime_encode_message_internal(tmp_msg, false, modified_src, false);
    17.8 +        mime_encode_message(tmp_msg, false, modified_src, false);
    17.9          if (!modified_src) {
   17.10              *flags &= (~PEP_decrypt_flag_src_modified);
   17.11              decrypt_status = PEP_CANNOT_REENCRYPT; // Because we couldn't return it, I guess.
   17.12 @@ -601,7 +601,7 @@
   17.13      }
   17.14  
   17.15      // FIXME: test with att
   17.16 -    status = _mime_encode_message_internal(dec_msg, false, mime_plaintext, false);
   17.17 +    status = mime_encode_message(dec_msg, false, mime_plaintext, false);
   17.18  
   17.19      if (status == PEP_STATUS_OK)
   17.20      {
   17.21 @@ -689,12 +689,7 @@
   17.22          goto pEp_error;
   17.23      }
   17.24      
   17.25 -    tmp_status = _mime_encode_message_internal(
   17.26 -                    ret_msg, 
   17.27 -                    false, 
   17.28 -                    mime_ciphertext, 
   17.29 -                    false);
   17.30 -    
   17.31 +    tmp_status = mime_encode_message(ret_msg, false, mime_ciphertext, false);     
   17.32      if (tmp_status != PEP_STATUS_OK)
   17.33          status = tmp_status;
   17.34  
   17.35 @@ -742,7 +737,7 @@
   17.36          goto pEp_error;
   17.37      }
   17.38  
   17.39 -    status = mime_encode_message(enc_msg, false, mime_ciphertext);
   17.40 +    status = mime_encode_message(enc_msg, false, mime_ciphertext, false);
   17.41  
   17.42  pEp_error:
   17.43      free_message(tmp_msg);