Skip to contentSkip to conversation

email output: Add MIME headers

PATCH New Ian Jackson 1 participant 1 message Apr 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 email output: Add MIME headers

We universally use UTF-8 in git commit messages and other kinds of messages. The RFC-*822 default is us-ascii. Fix this by providing a set of MIME headers.

---
 Osstest.pm         | 6 ++++++
 cri-args-hostlists | 1 +
 mg-execute-flight  | 2 ++
 3 files changed, 9 insertions(+)
Osstest.pm +6 -0
index ceb62ca..2263786 100644
@@ -246,6 +246,12 @@ sub readglobalconfig () {
 
     $c{DebianMirrorHost} ||= 'ftp.debian.org' if $c{DebianMirrorProxy};
 
+    $c{EmailStdHeaders} ||= <<'END';
+Content-Type: text/plain; charset="UTF-8"
+Content-Transfer-Encoding: 8bit
+MIME-Version: 1.0
+END
+
     my $pubbaseprefix = $c{PubBaseDir} ? "$c{PubBaseDir}/" : "";
     foreach my $l (qw(logs results)) {
 	my $u = ucfirst $l;
cri-args-hostlists +1 -0
index 58a2252..a75ff7b 100644
@@ -103,6 +103,7 @@ start_email () {
 		cat $OSSTEST_EMAIL_HEADER
 	fi
 	echo "Message-ID: <[email protected]>"
+	printf '%s\n' "`getconfig EmailStdHeaders`"
 	printf 'Subject: %s' "${subject_prefix:-[$branch test] }"
 
 	local flight_html_dir=$OSSTEST_HTMLPUB_DIR/
mg-execute-flight +2 -0
index 5a861b0..98aca45 100755
@@ -58,6 +58,7 @@ if [ x"$flight" = x ]; then badusage; fi
 
 : ${blessing:=play}
 : ${email:=`getconfig Username`}
+: ${email_std_headers:=`getconfig EmailStdHeaders`}
 
 set +e
 tty=`exec 2>/dev/null; tty`
@@ -88,6 +89,7 @@ exec >tmp/$flight.email
 cat <<END
 To: $email
 Subject: [adhoc test] $subject
+$email_std_headers
 
 $OSSTEST_RESOURCE_PREINFO
 END
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel