Skip to content

Commit

Permalink
lib-mail: Fix message_part_data_is_plain_7bit()
Browse files Browse the repository at this point in the history
Content-Type parameters weren't handled exactly right.
Broken by recent changes.
  • Loading branch information
sirainen committed Jan 30, 2017
1 parent b02cd3f commit 89bc31f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lib-mail/message-part-data.c
Expand Up @@ -39,10 +39,12 @@ bool message_part_data_is_plain_7bit(const struct message_part *part)
return FALSE;

/* only allowed parameter is charset=us-ascii, which is also default */
if (data->content_type_params_count > 0 &&
(strcasecmp(data->content_type_params[0].name, "charset") != 0 ||
strcasecmp(data->content_type_params[0].value,
MESSAGE_PART_DEFAULT_CHARSET) != 0))
if (data->content_type_params_count == 0) {
/* charset defaults to us-ascii */
} else if (data->content_type_params_count != 1 ||
strcasecmp(data->content_type_params[0].name, "charset") != 0 ||
strcasecmp(data->content_type_params[0].value,
MESSAGE_PART_DEFAULT_CHARSET) != 0)
return FALSE;

if (data->content_id != NULL ||
Expand Down

0 comments on commit 89bc31f

Please sign in to comment.