summaryrefslogtreecommitdiff
path: root/nsa
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2011-05-20 19:17:33 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2011-05-20 19:17:33 +0000
commit3914c5775341b2ab8e33f104ca1c628af7a4e64b (patch)
treee8bd4ee6c60935d0ded23cb08d07f1250bd8e8e0 /nsa
parent1ea3cf0dc91ab530f624a3a25d6f1da63910ed30 (diff)
hopefully teach nsa base64
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@480 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'nsa')
-rwxr-xr-xnsa8
1 files changed, 8 insertions, 0 deletions
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