Postfix在行尾发送带有“=”字符的Exchange Server

时间:2013-02-18 13:12:29

标签: php email postfix-mta exchange-server quoted-printable

我使用mail()函数通过后缀MTA在PHP中创建了一个自动通知系统。但是,Outlook的用户实际上是Exchange Server在行尾和“HTML”中接收带有相同“=”字符的通知。

Exchange Server识别 html / text ,但是它有“软换行符”或解码引用可打印或解析它的问题?我该如何解决这个问题?

以下是我使用的编码和架构:

MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="8-10000000000-10000000000:87141"
Message-Id: <20130218130031.E9923D98115@diplo-www>
Date: Mon, 18 Feb 2013 14:00:31 +0100 (CET)

--8-10000000000-10000000000:87141
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

--8-10000000000-10000000000:87141
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

--8-10000000000-10000000000:87141--

这是原始身体:

MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="8-10000000000-10000000000:87141"

--8-10000000000-10000000000:87141
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=0A=0A=0A=0A       NOTIFICATION=0A=0A  =0A    A new post was added  in:=0A=
=09IGCBP11 Europe 123=0A=0A    =0A=09=09Test 4 - exchange server header=0A=
=0A=09=09=0A=09This is test mail. It should be html/text formated via quote=
d-printable encoding.=0A=0A    =0A=09=09Author: Branislav Kurbalija=0A=0A=
=09Reply online=0A=09=0A=0A=09=0A=09=09To change your account properties or=
=0A=09=09password go to preferences=0A=09=0A=09=09www.diplomacy.edu=0A=09=
=0A=0A  =0A=09=09=09=09=09=0A=09This=0A=09is an automatically generated e-m=
ail notification.Please do not=0A=09respond by e-mail as your message will =
not be read.=09=09=09=09=0A  =0A=0A=0A
--8-10000000000-10000000000:87141
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=0A<CENTER>=0A=0A<div style=3D"font-family: arial, sans-serif; font-size: 1=
4px; width:=0A  600px; border: 1px solid #666666; color: #333333;=0A  text-=
align: left; border-radius: 2px;">=0A       <div style=3D"background-color:=
#008191; color: #ffffff; height: 15px;=0A  padding: 20px; border-bottom: 1p=
x solid #666666; margin-bottom: 5px;">NOTIFICATION</div>=0A=0A  <div style=
=3D"padding: 20px;">=0A    A new post was added  in:<br>=0A=09<A HREF=3D"ht=
tp://wsrv05.diplomacy.edu/textus22/?class=3D1#87">IGCBP11 Europe 123</A><BR=
>=0A=0A    <div style=3D"font-weight: bold; margin: 20px 0px 10px 0px;">=0A=
=09=09Test 4 - exchange server header</div>=0A=0A=09=09<p>=0A=09This is<str=
ong> test mail</strong>. It should be <span style=3D"background-color:yello=
w;">html/text</span> formated via quoted-printable encoding.</p>=0A=0A    <=
div style=3D"color: #525252; margin-top: 10px; text-align: right;">=0A=09=
=09Author: Branislav Kurbalija</div>=0A=0A=09<a href=3D"http://wsrv05.diplo=
macy.edu/textus22/?class=3D1#87">Reply online</a>=0A=09<hr>=0A=0A=09<div st=
yle=3D"font-size: 11px; float: left;">=0A=09=09To change your account prope=
rties or=0A=09=09password go to <A HREF=3D"http://wsrv05.diplomacy.edu/text=
us22/cantina/profile.php?user=3D941&class=3D1">preferences</A></div>=0A=09<=
div style=3D"font-size: 11px; float: right;">=0A=09=09<A HREF=3D"http://www=
.diplomacy.edu/">www.diplomacy.edu</a>=0A=09</div>=0A=0A  </div>=0A=09=09=
=09=09=09=0A=09<div style=3D"font-size: 11px; background-color:#eee; height=
: 24px;=0A=09  padding: 7px; margin-top: 20px; border-top: 1px solid #66666=
6; text-align: center;">This=0A=09is an automatically generated e-mail noti=
fication.<br>Please do not=0A=09respond by e-mail as your message will not =
be read.</div>=09=09=09=09=0A  =0A</div>=0A</CENTER>=0A
--8-10000000000-10000000000:87141--

1 个答案:

答案 0 :(得分:1)

quoted_printable_encode()和MS Outlook存在问题(请参阅https://github.com/php/php-src/pull/120)。所以你必须自己升级你的php或实现quoted-printable,或者改用base64。