Describe the bug
fetcher/fetcher.go:135-143:
mediaType, params, err := mime.ParseMediaType(header.Get("Content-Type"))
if err != nil {
body, readErr := io.ReadAll(reader)
if readErr != nil { ... }
return string(body), nil
}
When Content-Type is malformed but a charset parameter would still have been parseable (or is implied), the fallback returns the raw bytes as a string with no charset transform. Non-UTF-8 emails (e.g. ISO-8859-1) render as mojibake.
Expected behavior
If parse fails, attempt a best-effort charset detection (or assume UTF-8 explicitly with transform.NewReader) instead of returning raw bytes.
Describe the bug
fetcher/fetcher.go:135-143:When Content-Type is malformed but a charset parameter would still have been parseable (or is implied), the fallback returns the raw bytes as a string with no charset transform. Non-UTF-8 emails (e.g. ISO-8859-1) render as mojibake.
Expected behavior
If parse fails, attempt a best-effort charset detection (or assume UTF-8 explicitly with
transform.NewReader) instead of returning raw bytes.