Some ENGINE-400-related fun, but we're not there yet. ENGINE-400
authorKrista Bennett <krista@pep-project.org>
Fri, 09 Mar 2018 03:18:15 +0100
branchENGINE-400
changeset 2558d2f67eaa8501
parent 2557 a83a5643b065
child 2559 1db16cd8e50c
Some ENGINE-400-related fun, but we're not there yet.
src/message_api.c
src/mime.c
     1.1 --- a/src/message_api.c	Fri Mar 09 07:14:55 2018 +0100
     1.2 +++ b/src/message_api.c	Fri Mar 09 03:18:15 2018 +0100
     1.3 @@ -3586,7 +3586,7 @@
     1.4      }
     1.5  
     1.6      // FIXME: test with att
     1.7 -    status = _mime_encode_message_internal(dec_msg, false, mime_plaintext, false);
     1.8 +    status = _mime_encode_message_internal(dec_msg, false, mime_plaintext, true);
     1.9  
    1.10      if (status == PEP_STATUS_OK)
    1.11      {
     2.1 --- a/src/mime.c	Fri Mar 09 07:14:55 2018 +0100
     2.2 +++ b/src/mime.c	Fri Mar 09 03:18:15 2018 +0100
     2.3 @@ -438,8 +438,7 @@
     2.4      return cl;
     2.5  }
     2.6  
     2.7 -static PEP_STATUS build_fields(const message *msg, struct mailimf_fields **result,
     2.8 -                               bool transport_encode)
     2.9 +static PEP_STATUS build_fields(const message *msg, struct mailimf_fields **result)
    2.10  {
    2.11      PEP_STATUS status = PEP_STATUS_OK;
    2.12      struct mailimf_fields * fields = NULL;
    2.13 @@ -518,19 +517,15 @@
    2.14          }
    2.15      }
    2.16  
    2.17 -    /* if (subject) */ {
    2.18 -        char *_subject = (transport_encode ? 
    2.19 -                          mailmime_encode_subject_header("utf-8", subject, 1) :
    2.20 -                          strdup(subject));
    2.21 -        if (_subject == NULL)
    2.22 -            goto enomem;
    2.23 +    char *_subject = mailmime_encode_subject_header("utf-8", subject, 1);
    2.24 +    if (_subject == NULL)
    2.25 +        goto enomem;
    2.26  
    2.27 -        r = _append_field(fields_list, MAILIMF_FIELD_SUBJECT,
    2.28 -                (_new_func_t) mailimf_subject_new, _subject);
    2.29 -        if (r) {
    2.30 -            free(_subject);
    2.31 -            goto enomem;
    2.32 -        }
    2.33 +    r = _append_field(fields_list, MAILIMF_FIELD_SUBJECT,
    2.34 +            (_new_func_t) mailimf_subject_new, _subject);
    2.35 +    if (r) {
    2.36 +        free(_subject);
    2.37 +        goto enomem;
    2.38      }
    2.39  
    2.40      if (msg->cc) {
    2.41 @@ -573,7 +568,7 @@
    2.42      }
    2.43  
    2.44      if (msg->in_reply_to) {
    2.45 -        clist *in_reply_to = stringlist_to_clist(msg->in_reply_to, transport_encode);
    2.46 +        clist *in_reply_to = stringlist_to_clist(msg->in_reply_to, true);
    2.47          if (in_reply_to == NULL)
    2.48              goto enomem;
    2.49  
    2.50 @@ -586,7 +581,7 @@
    2.51      }
    2.52  
    2.53      if (msg->references) {
    2.54 -        clist *references = stringlist_to_clist(msg->references, transport_encode);
    2.55 +        clist *references = stringlist_to_clist(msg->references, true);
    2.56          if (references == NULL)
    2.57              goto enomem;
    2.58  
    2.59 @@ -599,7 +594,7 @@
    2.60      }
    2.61  
    2.62      if (msg->keywords) {
    2.63 -        clist *keywords = stringlist_to_clist(msg->keywords, transport_encode);
    2.64 +        clist *keywords = stringlist_to_clist(msg->keywords, true);
    2.65          if (keywords == NULL)
    2.66              goto enomem;
    2.67  
    2.68 @@ -612,9 +607,7 @@
    2.69      }
    2.70  
    2.71      if (msg->comments) {
    2.72 -        char *comments = (transport_encode ?
    2.73 -                          mailmime_encode_subject_header("utf-8", msg->comments, 0) :
    2.74 -                          strdup(msg->comments));
    2.75 +        char *comments = mailmime_encode_subject_header("utf-8", msg->comments, 0);
    2.76          if (comments == NULL)
    2.77              goto enomem;
    2.78  
    2.79 @@ -632,9 +625,7 @@
    2.80              char *key = _l->value->key;
    2.81              char *value = _l->value->value;
    2.82              if (key && value) {
    2.83 -                char *_value = (transport_encode ?
    2.84 -                                mailmime_encode_subject_header("utf-8", value, 0) :
    2.85 -                                strdup(value));
    2.86 +                char *_value = mailmime_encode_subject_header("utf-8", value, 1);
    2.87                  if (_value == NULL)
    2.88                      goto enomem;
    2.89  
    2.90 @@ -997,7 +988,7 @@
    2.91      mime = NULL;
    2.92  
    2.93      if (!omit_fields) {
    2.94 -        status = build_fields(msg, &fields, transport_encode);
    2.95 +        status = build_fields(msg, &fields);
    2.96          if (status != PEP_STATUS_OK)
    2.97              goto pep_error;
    2.98