From 54cbc534fccc34352d19d301ab8c80a8c2b92800 Mon Sep 17 00:00:00 2001
From: Sergey Matveev <stargrave@stargrave.org>
Date: Wed, 20 May 2020 11:38:14 +0300
Subject: [PATCH] RFC 2047 decode From

---
 cmd/sgblog-comment-add/main.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cmd/sgblog-comment-add/main.go b/cmd/sgblog-comment-add/main.go
index e74558e..840c378 100644
--- a/cmd/sgblog-comment-add/main.go
+++ b/cmd/sgblog-comment-add/main.go
@@ -26,6 +26,7 @@ import (
 	"fmt"
 	"io/ioutil"
 	"log"
+	"mime"
 	"net/mail"
 	"os"
 	"os/exec"
@@ -79,6 +80,10 @@ func main() {
 	if len(body) == 0 {
 		log.Fatal("no body")
 	}
+	from, err = new(mime.WordDecoder).DecodeHeader(from)
+	if err != nil {
+		log.Fatal(err)
+	}
 
 	subj = strings.TrimPrefix(subj, "Re: ")
 	if h, err := hex.DecodeString(subj); err != nil || len(h) != sha1.Size {
-- 
2.51.0