[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH] 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.

Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest.pm         | 6 ++++++
 cri-args-hostlists | 1 +
 mg-execute-flight  | 2 ++
 3 files changed, 9 insertions(+)

diff --git a/Osstest.pm b/Osstest.pm
index ceb62ca..2263786 100644
--- a/Osstest.pm
+++ b/Osstest.pm
@@ -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;
diff --git a/cri-args-hostlists b/cri-args-hostlists
index 58a2252..a75ff7b 100644
--- a/cri-args-hostlists
+++ b/cri-args-hostlists
@@ -103,6 +103,7 @@ start_email () {
                cat $OSSTEST_EMAIL_HEADER
        fi
        echo "Message-ID: <osstest-$flight-mainreport@xxxxxxx>"
+       printf '%s\n' "`getconfig EmailStdHeaders`"
        printf 'Subject: %s' "${subject_prefix:-[$branch test] }"
 
        local flight_html_dir=$OSSTEST_HTMLPUB_DIR/
diff --git a/mg-execute-flight b/mg-execute-flight
index 5a861b0..98aca45 100755
--- a/mg-execute-flight
+++ b/mg-execute-flight
@@ -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
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.