在邮件列表里显示的标题和发件人是正常的
但打开邮件除了标题是正常的,其他都是乱码
比较诡异的是就连发件人、收件人、日期这几个字都成了乱码
(显示正常的中文都是图片)
换过编码也不行
已经把中文 Windows 10 上所有字体都复制了过来
别的中文邮件就是正常的,比如
这是怎么回事?
在邮件列表里显示的标题和发件人是正常的
但打开邮件除了标题是正常的,其他都是乱码
比较诡异的是就连发件人、收件人、日期这几个字都成了乱码
换过编码也不行
已经把中文 Windows 10 上所有字体都复制了过来
别的中文邮件就是正常的,比如
应该是中文编码惹的祸。
KMail 应该也有本地 mailbox 的,直接跳过 UI 去那个 mailbox 把那封信的文本提出来。用 file 命令去分析。
直接保存成.mbox 文件也是的吧?
保存后用 kate 打开开头是这些内容
From ccsvc@message.cmbchina.com Sat Feb 29 03:00:28 2020
Received: from BN3NAM04HT045.eop-NAM04.prod.protection.outlook.com
(2603:1096:202::14) by HK0PR03MB3907.apcprd03.prod.outlook.com with HTTPS via
HK2PR0302CA0004.APCPRD03.PROD.OUTLOOK.COM; Sat, 29 Feb 2020 03:01:06 +0000
Received: from BN3NAM04FT036.eop-NAM04.prod.protection.outlook.com
(10.152.92.52) by BN3NAM04HT045.eop-NAM04.prod.protection.outlook.com
(10.152.93.6) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.15; Sat, 29 Feb
2020 03:00:54 +0000
Authentication-Results: spf=pass (sender IP is 113.100.142.168)
smtp.mailfrom=message.cmbchina.com; outlook.com; dkim=none (message not
signed) header.d=none;outlook.com; dmarc=bestguesspass action=none
header.from=message.cmbchina.com;compauth=pass reason=109
Received-SPF: Pass (protection.outlook.com: domain of message.cmbchina.com
designates 113.100.142.168 as permitted sender)
receiver=protection.outlook.com; client-ip=113.100.142.168;
helo=mail.message.cmbchina.com;
Received: from mail.message.cmbchina.com (113.100.142.168) by
BN3NAM04FT036.mail.protection.outlook.com (10.152.93.184) with Microsoft SMTP
Server id 15.20.2772.14 via Frontend Transport; Sat, 29 Feb 2020 03:00:50
+0000
X-IncomingTopHeaderMarker:
OriginalChecksum:5D4E52083DFFB1F3B7D5730B9F3820CBDC4B9A03446B51A2C4E998CC28A3B77C;UpperCasedChecksum:1CEB89925DC63976C217CC220B5E99C0947B68036D4C2A036965F0DF72704799;SizeAsReceived:443;Count:8
Received: from server by mail.message.cmbchina.com with SMTP 29 Feb 2020 11:00:28
+0800 (CST)
From: =?gb2312?B?1dDJzNL40NDQxdPDv6g=?=ccsvc@message.cmbchina.com
Message-ID: 00152361-00003212-00000002@mail.message.cmbchina.com
To: zhangy.me@outlook.com,
Date: Sat, 29 Feb 2020 11:00:28 +0800
Content-Type: multipart/mixed;
boundary=“__=_Part_Boundary_006_016219.019983”
Subject: =?gb2312?B?w7/I1dDF08O53LzS?=
X-IncomingHeaderCount: 8
Return-Path: ccsvc@message.cmbchina.com
X-MS-Exchange-Organization-ExpirationStartTime: 29 Feb 2020 03:00:52.6918
(UTC)
X-MS-Exchange-Organization-ExpirationStartTimeReason: OriginalSubmit
X-MS-Exchange-Organization-ExpirationInterval: 1:00:00:00.0000000
X-MS-Exchange-Organization-ExpirationIntervalReason: OriginalSubmit
X-MS-Exchange-Organization-Network-Message-Id:
e74a2970-5a5b-43ee-9b3e-08d7bcc39690
X-EOPAttributedMessage: 0
X-EOPTenantAttributedMessage: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa:0
X-MS-Exchange-Organization-MessageDirectionality: Incoming
X-Forefront-Antispam-Report: EFV:NLI;
X-MS-Exchange-Organization-AuthSource:
BN3NAM04FT036.eop-NAM04.prod.protection.outlook.com
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-PublicTrafficType: Email
X-MS-UserLastLogonTime: 2/29/2020 2:54:51 AM
X-MS-Office365-Filtering-Correlation-Id: e74a2970-5a5b-43ee-9b3e-08d7bcc39690
X-MS-TrafficTypeDiagnostic: BN3NAM04HT045:
X-MS-Exchange-EOPDirect: true
X-Sender-IP: 113.100.142.168
X-SID-PRA: CCSVC@MESSAGE.CMBCHINA.COM
X-SID-Result: PASS
X-MS-Exchange-Organization-PCL: 2
X-MS-Exchange-AtpMessageProperties: SA|SL
X-Microsoft-Antispam: BCL:1;
X-MS-Exchange-Safelinks-Url-KeyVer: 1
X-MS-Exchange-ATPSafeLinks-Stat: 0
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2020 03:00:50.9858
(UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e74a2970-5a5b-43ee-9b3e-08d7bcc39690
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-FromEntityHeader: Internet
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg:
00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3NAM04HT045
X-MS-Exchange-Transport-EndToEndLatency: 00:00:15.4091010
X-MS-Exchange-Processed-By-BccFoldering: 15.20.2772.006
X-Microsoft-Antispam-Mailbox-Delivery:
abwl:0;wl:0;pcwl:0;kl:0;iwl:0;ijl:0;dwl:0;dkl:0;rwl:0;ucf:0;jmr:0;ex:0;auth:1;dest:I;ENG:(5062000261)(5061607266)(5061608174)(4900115)(4920090)(6515079)(4950130)(4990090);
X-Message-Info:
5vMbyqxGkddhh69sIkKp9ni0X74jJC4hxwwqpa4ezByhVxt7hMcRmPdhX7tVeJI9q49TpjTNKvGPFDg40tegg0JZACLqLp93k4UDOMK1Z4kQURvWjCun7ztWw+mI3vjrzaSg6IbkzASz7lD+w8th9jRASmblxkCulHqb9dKqQgigVd/LrUHNmDO5tiP23QVzNTsryzknioxjczyFgomscQ==
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTE7YT0xO0Q9MTtHRD0xO1NDTD0z
X-Microsoft-Antispam-Message-Info:
=?gb2312?B?VktjaEwyQUFIbDFjWDk5d0Rza2pwVlFnZTNJaG80bGtneDV0S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jL0xmbkhvd3lIa3E2MWViWUQ5dTZEOU5kQ1FZb3VSSGFK?=
=?gb2312?B?akx3Y3JTY0NJNksxeVB6b3NsOStjVVBCQjVCMEJ4dFRCK1I1bHhwTUpXK014?=
=?gb2312?B?NHpGRVNpa21LSWZJVDQ0RllYbHlYZTZBMkE5QnlDWThtVkpoMFVDTEFlTDQr?=
=?gb2312?B?L3VKb2Z5TmJXYURKY1pOOWpTNHIvU2ZrM01tVXhtUmZkKzhpamp6Ky91Vmov?=
=?gb2312?B?OEJDUDJPV0xyL1ZQdlZvSkE5azJJSytXUFRBb1NxYjJlc0hLanoxbmVQMm1t?=
=?gb2312?B?bkxnWFVFT2xRZFNpak81RENFZ09USTVsUWwwWVJvOU5vZm92eG1Tdy9tS1h3?=
=?gb2312?B?Q2Fsemc4MVh3NVErUitmSFdsRGRlTVlsbmVUTERVNC8xbDBGZldHZzAzK0Rh?=
=?gb2312?B?aFpzaUM5OS9BRDR1RVJ0a1lYcjBlZGZLajA5YzIvV1JkQnBCVGlRZGpGdEFh?=
=?gb2312?Q?uvqu8Yr0gTtFPwuKzHrlYi2OdgkSkTkQ=3D?=
MIME-Version: 1.0–__=_Part_Boundary_006_016219.019983
Content-Type: text/html;
charset=“gb2312”
Content-Transfer-Encoding: base64
貌似是 GB2312 编码
但 KMail 切换成 GB2312 也还是乱码
正文是 HTML 富文本排版,自己一个 encoding
这样吗?
file -i --extension -z 每日信用管家.mbox
每日信用管家.mbox: application/octet-stream; charset=us-ascii
US ASCII 没法显示汉字
这个 kmail 属实垃圾,建议弃用
可以考虑 thunderbird 雷鸟,跟 kontact 比不差的。kontact 全家桶,bug 还是不少。占用资源也大一些。现在不用了。改用雷鸟了。
我感觉是这封信在头部把自己的编码说成是 ASCII,实际正文是 GB2312。你把 .mbox 里的个人信息删掉,附件发出来让我验证一下。
大约过年的时候,在 kde 提交了一个 kmail 账户助手不能正确添加账户的 bug,貌似到现在还没有解决~~
私信发了,谢谢
真相水落石出了:招行信用卡邮件的 HTML 富文本宣称自己是 gb2312。实际上不是,它的编码是 gb18030。
稍后可以给你写个简单的小程序处理 mbox,把标题和内容处理成 utf-8 编码。
感谢
不过还是不明白
那为什么把编码切换成 GB18030 也显示不了?
还有为何收件人发件人时间这几个字也是乱的,这几个字不是由 KMail 显示的吗?
因为这封邮件的 content 是个 base64 加密过的 html。html charset 是 gb2312,但是 HTML content 的 encoding 是 gb18030。你不解密改不了。所以你在 kmail 里选了 gb18030,解密开的 HTML 还是用 charset 指定的 gb2312 显示。还是乱码。
至于 Subject 也是这样的,“=?gb2312?B?XXXX?=“ 的意思就是说 gb2312 的 encoding,base64 加密。
这种情况是必须写程序转码的…其实代码已经做好了,就是测试时候导入新的 mbox 发现内容显示为空白。我感觉可能是同一封信里不能既出现 gb2312 encoding 又出现 utf-8 encoding。所以还需要完善。如果不导入只是要看这封信的内容,我这边已经能看到了
哈哈,就这样吧
知道是怎么回事就行了,不用麻烦了
要看邮件别的地方看就行