From: Christian Kastner <ckk@kvr.at>
Date: Sat, 26 Dec 2015 19:04:25 +0100
Subject: Send proper 8-bit emails

Cron sends 8-bit emails, so it needs to send these mails as 8BITMIME.  This
involves passing -B8BITMIME so that sendmail knows what kind of data to expect,
as well as sending an appropriate MIME-Version and Content-Transfer-Encoding
header.

Without these changes, mail servers that reject non-MIME 8-bit emails will
reject cron's messages.

Fix provided by brian m. carlson <sandals@crustytoothpaste.net>.

Bug-Debian: https://bugs.debian.org/694686
Forwarded: no
Last-Update: 2015-12-26
---
 config.h     | 2 +-
 do_command.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/config.h b/config.h
index 7a8e2fc..2940392 100644
--- a/config.h
+++ b/config.h
@@ -42,7 +42,7 @@
 			 */
 
 #define MAILCMD _PATH_SENDMAIL					/*-*/
-#define MAILARGS "%s -FCronDaemon -odi -oem -or0s %s"		/*-*/
+#define MAILARGS "%s -FCronDaemon -odi -oem -or0s -B8BITMIME %s"		/*-*/
 			/* -Fx	 = set full-name of sender
 			 * -odi	 = Option Deliverymode Interactive
 			 * -oem	 = Option Errors Mailedtosender
diff --git a/do_command.c b/do_command.c
index 73362a6..b649c61 100644
--- a/do_command.c
+++ b/do_command.c
@@ -407,6 +407,9 @@ child_process(e, u)
 				fprintf(mail, "Date: %s\n",
 					arpadate(&TargetTime));
 # endif /* MAIL_DATE */
+				fprintf(mail, "MIME-Version: 1.0\n");
+				fprintf(mail, "Content-Transfer-Encoding: 8bit\n");
+
 				for (env = e->envp;  *env;  env++)
 					fprintf(mail, "X-Cron-Env: <%s>\n",
 						*env);
