Add buildCommandEmail
Aedric Donovan aedric@c3f.net
Fri, 15 Nov 2019 12:46:29 -0600
1 files changed,
14 insertions(+),
0 deletions(-)
jump to
M
main.go
→
main.go
@@ -270,6 +270,20 @@ }
return false } +func buildCommandEmail(e *email.Email, t string) *email.Email { + email := email.NewEmail() + email.Sender = gConfig.CommandAddress + email.From = "<" + gConfig.CommandAddress + ">" + email.To = []string{e.From} + email.Recipients = []string{e.From} + email.Subject = e.Subject + email.Text = []byte(t) + email.Headers["Date"] = []string{time.Now().Format("Mon, 2 Jan 2006 15:04:05 -0700")} + email.Headers["Precedence"] = []string{"list"} + email.Headers["List-Help"] = []string{"<mailto:" + gConfig.CommandAddress + "?subject=help>"} + return email +} + func buildListEmail(e *email.Email, l *List) *email.Email { addresses := []string{} m, _ := mail.ParseAddress(e.From)