我刚刚安装了 hMailServer 和 Thunderbird 并设法让它们相互通信。
当 Thunderbird 从服务器获取消息时(顺便说一下,这一切都在本地运行),主题会按应有的方式显示在列表中,但正文是空白的。
按 Ctrl+U 显示源代码可显示完整的消息,只是未显示在电子邮件客户端中。
在网上阅读了一些内容后,我已经尝试取消选择“查看”->“内联显示附件”,并切换“查看”->“消息正文为”->“*”下的所有选项。
其中包含原始消息,为了我自己的安全,其中某些部分被删除。
Return-Path: [email protected]
Received: from my-laptop ([127.0.0.1])
by localhost
; Thu, 18 Nov 2010 17:49:45 -0500
Subject: =?utf-8?Q?Forgot_your_password_on_Localhost=3f?=
To: test@localhost
X-PHP-Originating-Script: 0:Email.php
User-Agent: CodeIgniter
Date: Thu, 18 Nov 2010 17:49:45 -0500
From: "Localhost" <[email protected]>
Return-Path: <[email protected]>
Reply-To: "Localhost" <[email protected]>
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_4ce5ad89986c6"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_4ce5ad89986c6
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Hi username,
Forgot your password, huh? No big deal.
To create a new password, just follow this link:
http://localhost/auth/reset_password/2/3958e7dded143056d5224941f23e93eb
You received this email, because it was requested by a Localhost user. This
is part of the procedure to create a new password on the system. If you DID
NOT request a new password then please ignore this email and your password
will remain the same.
Thank you,
The Localhost Team
--B_ALT_4ce5ad89986c6
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.=
w3.org/TR/html4/loose.dtd">
<html>
<head><title>Create a new password on Localhost</title></head>
<body>
<div style=3D"max-width: 800px; margin: 0; padding: 30px 0;">
<table width=3D"80%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
<tr>
<td width=3D"5%"></td>
<td align=3D"left" width=3D"95%" style=3D"font: 13px/18px Arial, Helvetica,=
sans-serif;">
<h2 style=3D"font: normal 20px/23px Arial, Helvetica, sans-serif; margin: 0=
; padding: 0 0 18px; color: black;">Create a new password</h2>
Forgot your password, huh? No big deal.<br />
To create a new password, just follow this link:<br />
<br />
<big style=3D"font: 16px/18px Arial, Helvetica, sans-serif;"><b><a href=3D"=
http://localhost/auth/reset_password/2/3958e7dded143056d5224941f23e93eb"=
style=3D"color: #3366cc;">Create a new password</a></b></big><br />
<br />
Link doesn't work? Copy the following link to your browser address bar:<br =
/>
<nobr><a href=3D"http://localhost/auth/reset_password/2/3958e7dded143056=
d5224941f23e93eb" style=3D"color: #3366cc;">http://localhost/auth/reset_=
password/2/3958e7dded143056d5224941f23e93eb</a></nobr><br />
<br />
<br />
You received this email, because it was requested by a <a href=3D"http://lo=
calhost/" style=3D"color: #3366cc;">Localhost</a> user. This is a part of t=
he procedure to create a new password on the system. If you DID NOT request=
a new password then please ignore this email and your password will remain=
the same.<br />
<br />
<br />
Thank you,<br />
The Localhost Team
</td>
</tr>
</table>
</div>
</body>
</html>
--B_ALT_4ce5ad89986c6--
提前感谢您给予我的一切帮助。
答案1
发生这种情况的原因是,您缺少一个空白的 crlf 来分隔标题和正文。电子邮件消息的格式如下:
Header1: blah\r\n
HeaderN: blah\r\n
\r\n
Body
我添加了\r\n
强调,但基本上,您使用空行(或本质上是双 crlf)将标题与内容分开。因此,您的电子邮件中的这个区域需要更改:
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_4ce5ad89986c6"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_4ce5ad89986c6
...并引入一个空白的 crlf...
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_4ce5ad89986c6"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_4ce5ad89986c6
希望这可以帮助!
安德鲁
答案2
我也遇到了这个问题,并且尝试了前面提到的修复方法:
- 取消选择“查看”->“内联显示附件”
- 切换“查看”->“消息正文为”->“*”下的所有选项
我无法控制入站消息的格式,因此添加 \r\n 不是一个选项。
最终奏效的是:
从:https://support.mozilla.org/en-US/questions/1073004
- 检查所有 Thunderbid 插件是否为最新版本
- 关闭 Thunderbird
- 重启盒子
我还确保整个 /etc/dovecot/conf.d/10-ssl.conf 文件已被注释掉,以防出现证书错误(或证书的权限错误),但我认为这无关。
现在它可以正常工作了,重启后一切都显示正常。希望这对以后的某人有所帮助。