Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISO-8859-1 header not decoded #176

Open
fundo-moretti opened this issue Sep 15, 2017 · 17 comments
Open

ISO-8859-1 header not decoded #176

fundo-moretti opened this issue Sep 15, 2017 · 17 comments
Labels

Comments

@fundo-moretti
Copy link

Header are not decoded when containing accented characters (ISO-8859-1).

Email header
To: Mrs =?ISO-8859-1?Q?Val=C3=A9rie=20Dupont?= <valerie.dupont@example.com>

Display in mailhog
To {{ tryDecodeMime((preview.Content.Headers["To"] || []).join(', ') || preview.To[0].Mailbox + "@" + preview.To[0].Domain) }}

Expected display
To: Mrs Valérie Dupont

@jdgrieco
Copy link

+1, same happens to me

@scara
Copy link

scara commented Sep 19, 2017

Are you sure?
ISO-8859-1 is made of 1 byte (8-bit character encoding) i.e. the OP's encoded string is based on UTF-8: indeed c3 a9 in utf-8 represents the latin small letter e with acute => é.

Try yourself by replacing ISO-8859-1 w/ UTF-8.

HTH,
Matteo

@fundo-moretti
Copy link
Author

You're right, I missed that point. Wrong configuration in my mailer, thanks.
Garbage in, garbage out...

Anyway, I was expecting the following output:
To: Mrs Valérie Dupont

which is more useful to me than {{ tryDecodeMime((...

Thanks,
Ivan

@scara
Copy link

scara commented Sep 20, 2017

That's correct, I was looking at the first expected value.

Wondering if this issue -w/ the new expected value - should be "moved" to mailhog/MailHog-UI.

@fundo-moretti
Copy link
Author

This is actually a duplicate of (closed) issue #89. ISO-8859-1 cannot be decoded.

JavaScript error:

angular-1.3.8.js:11594 ReferenceError: ISO88591_MAP_ENCODED is not defined
    at maybeInitIso88591Maps (strutil.js:392)
    at convertIso88591BytesToUnicodeCodePoints (strutil.js:487)
    at convertBytesToUnicodeCodePoints (strutil.js:727)
    at unescapeFromMime (strutil.js:985)
    at ChildScope.$scope.tryDecodeMime (controllers.js:185)
    at $parseFunctionCall (angular-1.3.8.js:12332)
    at Object.expressionInputWatch (angular-1.3.8.js:12735)
    at Scope.$digest (angular-1.3.8.js:14217)
    at Scope.$apply (angular-1.3.8.js:14488)
    at HTMLBodyElement.<anonymous> (angular-1.3.8.js:22954)

Not fixed in MailHog v1.0.0

@scara
Copy link

scara commented Sep 20, 2017

mailhog/MailHog-UI@2ed49d7, the fix for #89 talks about 3 new files that actually are in v1.0.0 of MailHog-UI: https://github.com/mailhog/MailHog-UI/tree/v1.0.0/assets/js.

HTH,
Matteo

@fundo-moretti
Copy link
Author

Yes, file iso88591_map.js is present in v1.0.0

GET /js/iso88591_map.js HTTP/1.1
Host: localhost:8025
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
...

HTTP/1.1 200 OK
Content-Type: application/javascript
Date: Wed, 20 Sep 2017 14:38:14 GMT
Transfer-Encoding: chunked

but it is not loaded, depite this comment https://github.com/mailhog/MailHog-UI/blob/v1.0.0/assets/js/strutil.js#L390

// Requires: iso88591_map.js should be loaded.

Ivan

@scara
Copy link

scara commented Sep 20, 2017

Apologize, I was trusting the comment in the code 😉.
Could you try to add what looks like missing here, from https://github.com/jupiter/node-strutil/blob/5e632e6489371c5b4f608d7091222921b79f9eeb/lib/strutil.js#L381 ? Just before https://github.com/mailhog/MailHog-UI/blob/ca6a9920f668fffc47b7f5489b12bc9fedfda6d2/assets/js/strutil.js#L388.

require calls are missing: maybe a diff between the sources could reveal any other missing.

HTH,
Matteo

@fundo-moretti
Copy link
Author

Yes, seems that only require calls are missing from strutils.js.
require itself is not defined (Uncaught ReferenceError: require is not defined).
If I manually define ISO88591_MAP_ENCODED with content of /js/iso88591_map.js (except the line with export because it is not defined either), well, encoded string is correctly decoded.

Thanks,
Ivan

@scara
Copy link

scara commented Sep 20, 2017

Quite new to MailHog, I missed the RequireJS missing 😊.
BTW, now there are all the bits and pieces to fix the mainstream, adding the missing definitions inline w/o loading them from external files.

@fundo-moretti
Copy link
Author

fundo-moretti commented Sep 26, 2017

Matteo, I'm not familiar with issues on GitHub.
Does it mean that you're going to fix this, or is there something else to be done?

Thanks,
Ivan

@dhobi
Copy link

dhobi commented Sep 5, 2018

+1 (almost the) same happens to me.

@xi-ao
Copy link

xi-ao commented Feb 9, 2021

Any news about this bug and the associated PR?

@dhobi
Copy link

dhobi commented Feb 9, 2021

The PR is still mergeable and works fine for me. I guess this issue might have to be resolved first though:
#340

@leonardobsjr
Copy link

Isn't the PR already merged? I thought this was actually fixed, but the latest Docker image still gives me this error :|

@stijnb1234
Copy link

Same issue for the Subject header. ^^

@reynadan
Copy link

Still an issue, is it planned to be in the future release ?

fbouliane pushed a commit to fbouliane/MailHog-UI that referenced this issue Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants