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

Unsupported charset "us=ascii" #520

Open
guldil opened this issue Oct 6, 2021 · 1 comment
Open

Unsupported charset "us=ascii" #520

guldil opened this issue Oct 6, 2021 · 1 comment
Labels

Comments

@guldil
Copy link

guldil commented Oct 6, 2021

Q A
ddeboer/imap version 1.12
PHP version 7.4.16
IMAP provider mdaemon 18

Summary

I'm trying to backup 400 000 emails and i have some random error about charset from very old emails (> 10 years !)

Unsupported charset :

[E_WARNING] Unsupported charset "us=ascii": mb_convert_encoding(): Illegal character encoding specified
imap_alerts (0):
imap_errors (0): #0 vendor/ddeboer/imap/src/Message/AbstractPart.php(231): Ddeboer\Imap\Message\Transcoder::decode()

Current behavior

Email message is not readable.

How to reproduce: code & error stack trace

Exemple with us=ascii :

Return-path: <[email protected]>
Authentication-Results: xxxxxx.net
	[email protected]; auth=pass
Received: from xxx-xxxx by xxxx.net
	(MDaemon PRO v9.0.6)
	with ESMTP id md50000059333.msg
	for <[email protected]>; Mon, 12 Feb 2007 14:17:12 +0100
Date: Mon, 12 Feb 2007 14:17:00 +0100
From: xxxxx xxxxxx<[email protected]>
Subject: RE: Urgent !
To: 'xxxxxx xxxxxxx' <[email protected]>
X-Priority: 3
X-Mailer: Outlook Connector for MDaemon 2.1.2
MIME-Version: 1.0
Content-Type: text/PLAIN; charset=us=ascii
X-Authenticated-Sender: [email protected]
X-Spam-Processed: xxxxx.net, Mon, 12 Feb 2007 14:17:12 +0100
	(not processed: sender in recipient's private address book)
X-MDRcpt-To: [email protected]
X-Rcpt-To: [email protected]
X-MDRemoteIP: xxxxxxxxxxxxxxxx
X-Return-Path: [email protected]
X-Envelope-From: [email protected]
X-MDaemon-Deliver-To: [email protected]
X-MDAV-Processed: l3ia.net, Mon, 12 Feb 2007 14:17:12 +0100

Expected behavior

No error because us=ascii is a valid charset : https://www.charset.org/charsets/us-ascii :)

I add 'us=ascii' => 'us-ascii' in vendor/ddeboer/imap/src/Message/Transcoder.php and it's working !

@guldil guldil added the bug label Oct 6, 2021
@Slamdunk
Copy link
Collaborator

Slamdunk commented Oct 6, 2021

Hi, can you propose a PR with your fix please?

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

2 participants