Fix erroneous header name in error message

The error message previously referenced a constant 'HeaderTo' which might not always be the header being parsed. The commit replaces this with 'addrHeader', significantly improving the accuracy of error messages.
This commit is contained in:
Winni Neessen 2024-06-25 09:47:12 +02:00
parent db9893f15a
commit faab5323fd
Signed by: wneessen
GPG key ID: 385AC9889632126E

2
eml.go
View file

@ -142,7 +142,7 @@ func parseEMLHeaders(mailHeader *netmail.Header, msg *Msg) error {
addrStrings = append(addrStrings, addr.String()) addrStrings = append(addrStrings, addr.String())
} }
if err = addrFunc(addrStrings...); err != nil { if err = addrFunc(addrStrings...); err != nil {
return fmt.Errorf(`failed to parse %q header: %w`, HeaderTo, err) return fmt.Errorf(`failed to parse %q header: %w`, addrHeader, err)
} }
} }
} }