~sircmpwn/core-go

86ad9b5a0000d0e319c212c4f2b1d54a45ef8625 — Conrad Hoffmann 6 months ago e7b8e02
server/email: use go-message for address parsing

No need to additionally depend on net/mail
1 files changed, 2 insertions(+), 4 deletions(-)

M server/email.go
M server/email.go => server/email.go +2 -4
@@ 7,7 7,6 @@ import (
	"fmt"
	"io"
	"log"
	gomail "net/mail"
	"runtime/debug"
	"strings"



@@ 58,13 57,12 @@ func EmailRecover(ctx context.Context, _origErr interface{}) error {
		log.Println("Warning: mail::error-to is not set")
		return fmt.Errorf("internal system error")
	}
	rcpt, err := gomail.ParseAddress(to)
	rcpt, err := mail.ParseAddress(to)
	if err != nil {
		log.Printf("Warning: mail::error-to is invalid: %v", err)
		return fmt.Errorf("internal system error")
	}
	addr := mail.Address(*rcpt)
	header.SetAddressList("To", []*mail.Address{&addr})
	header.SetAddressList("To", []*mail.Address{rcpt})

	var reader io.Reader
	func() {