mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-23 14:10:50 +01:00
Compare commits
2 commits
db9893f15a
...
8b1208949f
Author | SHA1 | Date | |
---|---|---|---|
8b1208949f | |||
faab5323fd |
1 changed files with 4 additions and 3 deletions
7
eml.go
7
eml.go
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,10 +369,11 @@ func handleEMLMultiPartBase64Encoding(multiPartData []byte, part *Part) error {
|
||||||
// separate map
|
// separate map
|
||||||
func parseMultiPartHeader(multiPartHeader string) (header string, optional map[string]string) {
|
func parseMultiPartHeader(multiPartHeader string) (header string, optional map[string]string) {
|
||||||
optional = make(map[string]string)
|
optional = make(map[string]string)
|
||||||
headerSplit := strings.SplitN(multiPartHeader, "; ", 2)
|
headerSplit := strings.SplitN(multiPartHeader, ";", 2)
|
||||||
header = headerSplit[0]
|
header = headerSplit[0]
|
||||||
if len(headerSplit) == 2 {
|
if len(headerSplit) == 2 {
|
||||||
optSplit := strings.SplitN(headerSplit[1], "=", 2)
|
optString := strings.TrimLeft(headerSplit[1], " ")
|
||||||
|
optSplit := strings.SplitN(optString, "=", 2)
|
||||||
if len(optSplit) == 2 {
|
if len(optSplit) == 2 {
|
||||||
optional[optSplit[0]] = optSplit[1]
|
optional[optSplit[0]] = optSplit[1]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue