small pixel drawing of a pufferfish clist

Return a proper from address
j3s j3s@c3f.net
Fri, 15 Nov 2019 13:05:46 -0600
commit

a22f6b40643d0a25da46ecf40a2442c7b4027f14

parent

f184069952fc132bf5a63ff94bc29ef3aa4ee249

1 files changed, 7 insertions(+), 2 deletions(-)

jump to
M main.gomain.go

@@ -266,11 +266,16 @@ return false

} func buildCommandEmail(e *email.Email, t bytes.Buffer) *email.Email { + from, err := mail.ParseAddress(e.From) + if err != nil { + log.Printf("WARN: CommandEmail: couldn't parse from address") + } + email := email.NewEmail() email.Sender = gConfig.CommandAddress email.From = "<" + gConfig.CommandAddress + ">" - email.To = []string{e.From} - email.Recipients = []string{e.From} + email.To = []string{from.Name + "<" + from.Address + ">"} + email.Recipients = []string{from.Address} email.Subject = e.Subject email.Text = []byte(t.String()) email.Headers["Date"] = []string{time.Now().Format("Mon, 2 Jan 2006 15:04:05 -0700")}