Postfix отправляет на Exchange Server символы "=" в конце строк
Я создал автоматизированную систему уведомлений в PHP, используя mail()
функция через постфикс MTA. Однако пользователи Outlook, на самом деле Exchange Server, получают уведомления с одинаковыми символами "=" в конце строк и с разбитым HTML.
Сервер Exchange распознал 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 ответ
Есть проблема с quoted_printable_encode()
и MS Outlook (см. https://github.com/php/php-src/pull/120). Таким образом, вы должны обновить свой php или внедрить quoted-printable самостоятельно, или использовать вместо него base64.