summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2011-12-14 01:57:13 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2011-12-14 01:57:13 (GMT)
commit27a9b7782ea8afa5c61eaa93200ebb73b892c558 (patch)
treeafede242e2ad5b568891c4a73ff7f438ee0726ce
parent3f9da4890ad3793d7939b322c3e889a7f917cd0c (diff)
downloadtip-bot-27a9b7782ea8afa5c61eaa93200ebb73b892c558.zip
tip-bot-27a9b7782ea8afa5c61eaa93200ebb73b892c558.tar.gz
tip-bot-27a9b7782ea8afa5c61eaa93200ebb73b892c558.tar.bz2
tip-bot-27a9b7782ea8afa5c61eaa93200ebb73b892c558.tar.xz
robotfmt: Make MIME-compliant
vger has bounced some stuff from us, because: 1. headers need to the RFC 2047 encoded; 2. we need a Content-Transfer-Encoding: 8bit header. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rwxr-xr-xrobotfmt.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/robotfmt.pl b/robotfmt.pl
index 747b748..f926b8f 100755
--- a/robotfmt.pl
+++ b/robotfmt.pl
@@ -5,6 +5,7 @@
use Email::Valid;
use URI::Escape;
+use Encode qw(encode decode);
($rev, $branches) = @ARGV;
@@ -69,6 +70,7 @@ X-Mailer: tip-git-log-daemon
Robot-ID: <tip-bot.git.kernel.org>
Robot-Unsubscribe: Contact <mailto:hpa\@kernel.org> to get blacklisted from these emails
MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8
Content-Disposition: inline
Precedence: bulk
@@ -100,6 +102,7 @@ $lkml = 'linux-kernel@vger.kernel.org';
$nullref = '<tip-*@git.kernel.org>';
open(LOG, "-|", "git log -M -C -C --pretty=format:\Q${format}\E -p --stat \Q${rev}^..${rev}\E") or die;
+binmode(LOG, ':utf8');
$header = 1;
$message_id = "<tip-${rev}\@git.kernel.org>";
while (defined($l = <LOG>)) {
@@ -110,6 +113,7 @@ while (defined($l = <LOG>)) {
# Strip quotes in From: if author string seems safe
$l = "From: $1 $2";
}
+ $l = encode('MIME-Header', $l);
} else {
if ($l =~ /^([a-z-]+-by|Cc|Author):\s.*<([^\>]+)>\s*$/i) {
$e = $2;