Closed
Description
Hi there,
I have a client that receives emails in either English or Cyrillic
As it stands I am not able to parse the Cyrillic ones because the subject/body gets all garbled up
For example this subject:
Резервация от Ски Училище
Gets converted to
Резе�ва�и� о� Ски У�или�е
Am happy to share headers and whatever you need to help me resolve this issue
this is the output of var_dump($message->header)
object(Webklex\PHPIMAP\Header)#2064 (4) {
["raw"]=>
string(1142) "Return-Path: <redacted@hulk.icnhost.net>
Delivered-To: office+redacted@redacted.com
Received: from hulk.icnhost.net
by hulk.icnhost.net with LMTP
id fF3sC6zH8F+MQwAAAsqQFQ
(envelope-from <redacted@hulk.icnhost.net>)
for <office+redacted@redacted.com>; Sat, 02 Jan 2021 21:21:16 +0200
Return-path: <redacted@hulk.icnhost.net>
Envelope-to: office@redacted.com
Delivery-date: Sat, 02 Jan 2021 21:21:16 +0200
Received: from localhost ([127.0.0.1]:34100 helo=hulk.icnhost.net)
by hulk.icnhost.net with smtp (Exim 4.92)
(envelope-from <redacted@hulk.icnhost.net>)
id 1kvmSi-0004Uj-2S
for office@redacted.com; Sat, 02 Jan 2021 21:21:16 +0200
Date: Sat, 02 Jan 2021 21:21:16 +0200
X-SG-User: redacted
X-SG-Opt: SCRIPT_FILENAME=/home/redacted/public_html/index.php REQUEST_URI=/bg/redacted/ PWD=/home/redacted/public_html REMOTE_ADDR=213.222.49.150
To: office@redacted.com
Subject: Резервация от Ски Училище
From:Redacted <office@redacted.com>
Reply-to:redacted@gmail.com
MIME-Version: 1.0
Content-type: text/html; charset=UTF-8
"
["attributes":protected]=>
array(18) {
["from"]=>
array(1) {
[0]=>
object(stdClass)#2066 (5) {
["personal"]=>
string(15) "Redacted"
["mailbox"]=>
string(6) "office"
["host"]=>
string(18) "redacted.com"
["mail"]=>
string(25) "office@redacted.com"
["full"]=>
string(43) "Redacted <office@redacted.com>"
}
}
["to"]=>
array(1) {
[0]=>
object(stdClass)#2065 (5) {
["personal"]=>
string(0) ""
["mailbox"]=>
string(6) "office"
["host"]=>
string(18) "redacted.com"
["mail"]=>
string(25) "office@redacted.com"
["full"]=>
string(25) "office@redacted.com"
}
}
["reply_to"]=>
array(1) {
[0]=>
object(stdClass)#2067 (5) {
["personal"]=>
string(0) ""
["mailbox"]=>
string(11) "redacted"
["host"]=>
string(9) "gmail.com"
["mail"]=>
string(21) "redacted@gmail.com"
["full"]=>
string(21) "redacted@gmail.com"
}
}
["subject"]=>
string(107) "Резе�ва�и� о� Ски У�или�е"
["date"]=>
object(Carbon\Carbon)#2069 (16) {
["constructedObjectId":protected]=>
string(32) "00000000441a3eec000000002479e6a7"
["localMonthsOverflow":protected]=>
NULL
["localYearsOverflow":protected]=>
NULL
["localStrictModeEnabled":protected]=>
NULL
["localHumanDiffOptions":protected]=>
NULL
["localToStringFormat":protected]=>
NULL
["localSerializer":protected]=>
NULL
["localMacros":protected]=>
NULL
["localGenericMacros":protected]=>
NULL
["localFormatFunction":protected]=>
NULL
["localTranslator":protected]=>
NULL
["dumpProperties":protected]=>
array(3) {
[0]=>
string(4) "date"
[1]=>
string(13) "timezone_type"
[2]=>
string(8) "timezone"
}
["dumpLocale":protected]=>
NULL
["date"]=>
string(26) "2021-01-02 21:21:16.000000"
["timezone_type"]=>
int(1)
["timezone"]=>
string(6) "+02:00"
}
["return_path"]=>
string(53) "<redacted@hulk.icnhost.net> <redacted@hulk.icnhost.net>"
["delivered_to"]=>
string(34) "office+redacted@redacted.com"
["received"]=>
array(10) {
[0]=>
string(21) "from hulk.icnhost.net"
[1]=>
string(29) "by hulk.icnhost.net with LMTP"
[2]=>
string(25) "id fF3sC6zH8F+MQwAAAsqQFQ"
[3]=>
string(42) "(envelope-from <redacted@hulk.icnhost.net>)"
[4]=>
string(73) "for <office+redacted@redacted.com>; Sat, 02 Jan 2021 21:21:16 +0200"
[5]=>
string(56) "from localhost ([127.0.0.1]:34100 helo=hulk.icnhost.net)"
[6]=>
string(41) "by hulk.icnhost.net with smtp (Exim 4.92)"
[7]=>
string(42) "(envelope-from <redacted@hulk.icnhost.net>)"
[8]=>
string(19) "id 1kvmSi-0004Uj-2S"
[9]=>
string(62) "for office@redacted.com; Sat, 02 Jan 2021 21:21:16 +0200"
}
["envelope_to"]=>
string(25) "office@redacted.com"
["delivery_date"]=>
string(31) "Sat, 02 Jan 2021 21:21:16 +0200"
["x_sg_user"]=>
string(7) "redacted"
["x_sg_opt"]=>
string(143) "SCRIPT_FILENAME=/home/redacted/public_html/index.php REQUEST_URI=/bg/redacted/ PWD=/home/redacted/public_html REMOTE_ADDR=213.222.49.150"
["mime_version"]=>
string(3) "1.0"
["content_type"]=>
string(9) "text/html"
["toaddress"]=>
string(25) "office@redacted.com"
["fromaddress"]=>
string(43) "Redacted <office@redacted.com>"
["reply_toaddress"]=>
string(21) "redacted@gmail.com"
["charset"]=>
string(5) "UTF-8"
}
["config":protected]=>
array(11) {
["delimiter"]=>
string(1) "/"
["fetch"]=>
int(2)
["sequence"]=>
int(3)
["fetch_body"]=>
bool(true)
["fetch_flags"]=>
bool(true)
["message_key"]=>
string(4) "list"
["fetch_order"]=>
string(3) "asc"
["dispositions"]=>
array(2) {
[0]=>
string(10) "attachment"
[1]=>
string(6) "inline"
}
["common_folders"]=>
array(5) {
["root"]=>
string(5) "INBOX"
["junk"]=>
string(10) "INBOX/Junk"
["draft"]=>
string(12) "INBOX/Drafts"
["sent"]=>
string(10) "INBOX/Sent"
["trash"]=>
string(11) "INBOX/Trash"
}
["decoder"]=>
array(2) {
["message"]=>
string(5) "utf-8"
["attachment"]=>
string(5) "utf-8"
}
["open"]=>
array(0) {
}
}
["fallback_encoding"]=>
string(5) "UTF-8"
}