From 3914c5775341b2ab8e33f104ca1c628af7a4e64b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 20 May 2011 19:17:33 +0000 Subject: hopefully teach nsa base64 git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@480 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- nsa | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nsa b/nsa index 0e6f180..c0573ac 100755 --- a/nsa +++ b/nsa @@ -419,6 +419,7 @@ while (1) do project = nil lines = [] commitmsg = "" + transfer_encoding = "plain" fh.readlines.each { |line| line.chomp! in_headers = false if line == "" @@ -430,6 +431,8 @@ while (1) do if m project = m[1]; end + elsif header.upcase == "Content-Transfer-Encoding" + transfer_encoding = content end elsif (not in_headers) lines.push line @@ -439,6 +442,11 @@ while (1) do fh.close File.unlink(filename) + if transfer_encoding == "base64" + require 'base64' + lines = Base64.decode64(lines.join()).split("\n") + end + if project.nil? puts "Ignoring invalid mail without project" next -- cgit v1.2.3