diff --git a/pkg/message/parser/part.go b/pkg/message/parser/part.go index 7b6debe5..78fdf02d 100644 --- a/pkg/message/parser/part.go +++ b/pkg/message/parser/part.go @@ -75,7 +75,11 @@ func (p *Part) ConvertToUTF8() error { } // HELP: Is this okay? What about when the charset is embedded in structured text type eg html/xml? + if params == nil { + params = make(map[string]string) + } params["charset"] = "utf-8" + p.Header.SetContentType(t, params) return nil diff --git a/test/features/bridge/smtp/send/failures.feature b/test/features/bridge/smtp/send/failures.feature index 099b2026..8fd3dfb8 100644 --- a/test/features/bridge/smtp/send/failures.feature +++ b/test/features/bridge/smtp/send/failures.feature @@ -38,4 +38,4 @@ Feature: SMTP wrong messages """ - Then SMTP response is "SMTP error: 554 Error: transaction failed, blame it on the weather: multipart: NextPart: EOF" + Then SMTP response is "SMTP error: 554 Error: transaction failed, blame it on the weather: unexpected EOF"