[Pkg-cron-devel] [pkg-cron] 16/19: Send proper 8-bit emails

Christian Kastner chrisk-guest at moszumanska.debian.org
Fri Oct 10 15:18:41 UTC 2014


This is an automated email from the git hooks/post-receive script.

chrisk-guest pushed a commit to branch ckk/cron-125
in repository pkg-cron.

commit 8029707d4ac7afd68d83cd6e21f5a2f3b56eb61a
Author: brian m. carlson <sandals at crustytoothpaste.net>
Date:   Wed Apr 30 23:35:25 2014 +0000

    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.
    
    Closes: #694686
---
 config.h     | 2 +-
 do_command.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/config.h b/config.h
index cb10abd..611a335 100644
--- a/config.h
+++ b/config.h
@@ -44,7 +44,7 @@
 
 #define MAILCMD _PATH_SENDMAIL					/*-*/
 /* #define MAILARGS "%s -i -FCronDaemon -odi -oem  %s"		/*-*/
-#define MAILARGS "%s -i -FCronDaemon -oem  %s"		/*-*/
+#define MAILARGS "%s -i -FCronDaemon -B8BITMIME -oem  %s"		/*-*/
 			/* -i    = don't terminate on "." by itself
                          * -Fx	 = set full-name of sender
 			 * -odi	 = Option Deliverymode Interactive
diff --git a/do_command.c b/do_command.c
index 18d097d..9f7240a 100644
--- a/do_command.c
+++ b/do_command.c
@@ -567,6 +567,7 @@ child_process(e, u)
 	fprintf(mail, "Date: %s\n",
 			arpadate(&StartTime));
 # endif /* MAIL_DATE */
+	fprintf(mail, "MIME-Version: 1.0\n");
 	if ( content_type == 0L ) {
 		fprintf(mail, "Content-Type: text/plain; charset=%s\n",
 				cron_default_mail_charset
@@ -595,6 +596,8 @@ child_process(e, u)
 
 		fprintf(mail,"Content-Transfer-Encoding: %s\n", content_transfer_encoding);
 	}
+	else
+		fprintf(mail, "Content-Transfer-Encoding: 8bit\n");
 
 	for (env = e->envp;  *env;  env++)
 		fprintf(mail, "X-Cron-Env: <%s>\n",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-cron/pkg-cron.git



More information about the Pkg-cron-devel mailing list