From 50cd54ef4e6f4279683b61417a35de7297b55b9d Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Wed, 2 May 2018 02:20:52 +0000 Subject: format-patch: make cover letters always text/plain When formatting a series of patches using --attach and --cover-letter, the cover letter lacks the closing MIME boundary, violating RFC 2046. Certain clients, such as Thunderbird, discard the message body in such a case. Since the cover letter is just one part and sending it as multipart/mixed is not very useful, always emit it as text/plain, avoiding the boundary problem altogether. Reported-by: Patrick Hemmer Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- log-tree.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'log-tree.c') diff --git a/log-tree.c b/log-tree.c index bdf23c5f7b..b00a56f57e 100644 --- a/log-tree.c +++ b/log-tree.c @@ -362,7 +362,8 @@ void fmt_output_email_subject(struct strbuf *sb, struct rev_info *opt) void log_write_email_headers(struct rev_info *opt, struct commit *commit, const char **extra_headers_p, - int *need_8bit_cte_p) + int *need_8bit_cte_p, + int maybe_multipart) { const char *extra_headers = opt->extra_headers; const char *name = oid_to_hex(opt->zero_commit ? @@ -385,7 +386,7 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit, opt->ref_message_ids->items[i].string); graph_show_oneline(opt->graph); } - if (opt->mime_boundary) { + if (opt->mime_boundary && maybe_multipart) { static char subject_buffer[1024]; static char buffer[1024]; struct strbuf filename = STRBUF_INIT; @@ -610,7 +611,7 @@ void show_log(struct rev_info *opt) if (cmit_fmt_is_mail(opt->commit_format)) { log_write_email_headers(opt, commit, &extra_headers, - &ctx.need_8bit_cte); + &ctx.need_8bit_cte, 1); ctx.rev = opt; ctx.print_email_subject = 1; } else if (opt->commit_format != CMIT_FMT_USERFORMAT) { -- cgit v1.2.3