listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

Bounces: unknown charset: message

Open priffo-karrott opened this issue 3 years ago • 16 comments
trafficstars

OS: Linux Mint. SMTP: Mandrillapp. POP: outlook.

I setted bounces pop with outlook email. So i have the next issue in logs: error scanning bounce mailbox: unknown charset: unknown charset: message: unhandled charset "iso-8859-1"

If i used gmail, pop. I have: error scanning bounce mailbox: EOF.

In the same cases, the bounce email arrives.

Can you help me?

priffo-karrott avatar Jan 03 '22 13:01 priffo-karrott

hm, looks like an issue with the POP3 mailbox scanner and this particular character encoding. This will need to be investigated and debugged.

knadh avatar Jan 04 '22 03:01 knadh

I also got this problem. Fixed by importing github.com/emersion/go-message/charset in https://github.com/knadh/listmonk/blob/d42c676503b42232e25620ab17d74f288ddd1109/internal/bounce/mailbox/pop.go#L8

import (
	"encoding/json"
	"regexp"
	"time"

	"github.com/emersion/go-message"
	_ "github.com/emersion/go-message/charset"
	"github.com/knadh/go-pop3"
	"github.com/knadh/listmonk/models"
)

I tested this and the error is gone and bounces work as expected.

an0nfunc avatar Jan 04 '22 16:01 an0nfunc

@jaredfolkins thanks! That indeed is the fix.

knadh avatar Jan 04 '22 17:01 knadh

I just updated and I still have this issue. v2.1.0 docker

app_1 | 2022/02/12 22:51:17 bounce.go:139: error scanning bounce mailbox: unknown charset: unknown charset: charset "us_ascii": htmlindex: invalid encoding name

redispade avatar Feb 12 '22 21:02 redispade

~~us_ascii is a weird encoding, and it's not supported by golang.org/x/text/encoding/charmap.~~ (Apparently that is how ASCII should be called now.) What server do you use?

an0nfunc avatar Feb 12 '22 22:02 an0nfunc

I use Mailu as smtp/pop, but it happens only with one account. I set another one and it works(inbox got emptied) but it didn't detect any bounces.

redispade avatar Feb 12 '22 22:02 redispade

Probably coming from a mail witch itself comes from some non-UTF-8-friendly source. I checked upstream (github.com/emersion/go-message) and they seem to have setup a method for handling such quirks already. Maybe you should open an issue there, this is probably out of scope for listmonk to handle. But I would wait until @knadh has had a look.

EDIT: What is weird is that us_ascii is listed in IANA's alias table here, which golang.org/x/text/encoding/ianaindex (us-ascii) is based on (and which is used by go-message), so it should be handled, but isn't. Not sure yet how that happens.

an0nfunc avatar Feb 12 '22 22:02 an0nfunc

Ah, that's a bummer ;( I'd tested this with multiple POP3 boxes including Gmail and Outlook. Any chance I get access to a POP box where this issue's happening? I can try and fix this quickly and release an RC so that you don't have to wait for the next versioned release.

knadh avatar Feb 13 '22 07:02 knadh

Ah, that's a bummer ;( I'd tested this with multiple POP3 boxes including Gmail and Outlook. Any chance I get access to a POP box where this issue's happening? I can try and fix this quickly and release an RC so that you don't have to wait for the next versioned release.

May I contact you via email (the one in your profile)?

EDIT: Today it actually worked. I found the mailbox empty. I don't know how, because I didn't delete any message. I would suggest to add a feature(like a checkbox) to not delete all messages from the bounce mailbox, just the bounce messages.

redispade avatar Feb 14 '22 10:02 redispade

May I contact you via email (the one in your profile)?

Yep.

I would suggest to add a feature(like a checkbox) to not delete all messages from the bounce mailbox, just the bounce messages.

That's not feasible unfortunately. POP doesn't have a state management system like IMAP to remember which mails have been read and which haven't been. If emails are not deleted, they will have to be scanned over and over. That's why bounce mailboxes should be dedicated and should not receive non-bounce emails.

knadh avatar Feb 14 '22 11:02 knadh

hey,

i have the same Error: error scanning bounce mailbox: EOF on the Version: v2.1.0 on a MS Exchange Mailbox which I use only for bounces

Gahrt avatar Jun 20 '22 11:06 Gahrt

@knadh I can give you access to a mailbox with a very similar problem:

error scanning bounce mailbox: unknown charset: unknown charset: charset "iso859-1": htmlindex: invalid encoding name

It should be iso8859-1.

NB: I had the problem in 2.1.0, still have it with 2.2.0.

ldidry avatar Sep 22 '22 11:09 ldidry

@ldidry could you please e-mail me a set of test credentials for the inbox? kailash [at] nadh.in

knadh avatar Sep 27 '22 04:09 knadh

Credentials sent 🙂

ldidry avatar Sep 27 '22 09:09 ldidry

Hello @knadh, did you had some time to test the credentials?

ldidry avatar Oct 28 '22 06:10 ldidry

Haven't had the time ;( Swamped.

knadh avatar Oct 31 '22 14:10 knadh