发送给MS Exchange收件人的WP邮件=偶尔出现电子邮件损坏?

时间:2015-11-16 作者:samJL

我的办公室处理来自WordPress表单的许多电子邮件收据(主要使用强大的Pro插件)。从过去6个月开始,每15封来自WP的电子邮件中就会有一封被破坏。电子邮件正文中将显示等号和断开的HTML。

我注意到,只有Outlook/Exchange客户端接收的邮件才会发生这种情况。在这种情况下,办公室中的每个人都在使用Exchange。抄送到Gmail或其他服务的相同电子邮件没有损坏。

以下细节使情况更加混乱,难以诊断:

这似乎不是Forgeble Pro特有的问题。其他通过WordPress发送电子邮件的插件也会受到影响

  • 我们的收件人正在使用最新版本的Exchange server(完全修补)
    • 我唯一能得出的结论是,它是WP Mail、MIME和Exchange的某种组合。下面是一封问题电子邮件的附加屏幕截图和修订标题。

      如果您能帮助我进一步诊断这个问题,我将不胜感激

      非常感谢。

      corrupt email body from wordpress

      Received: from smtp.school.edu (XXX.XXX.XXX.XXX) by email.school.edu
       (XXX.XXX.XXX.XXX) with Microsoft SMTP Server id 14.3.266.1; Sun, 15 Nov 2015
       21:15:40 -0600
      DKIM-Signature: [v=1; a=rsa-sha1; c=relaxed/relaxed;
        s=s1024; d=school.edu;
        h=subject:to:date:from:message-id:mime-version:content-type;
        bh=XXXXXX;
        b=XXXXXX
      DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=s1024; d=school.edu;
        h=subject:to:date:from:message-id:mime-version:content-type;
        b=XXXXXX
      Received: from WWW1.school.edu ([XXX.XXX.XXX.XXX]) by smtp.school.edu with
       Microsoft SMTPSVC(7.0.6002.18264);  Sun, 15 Nov 2015 21:15:40 -0600
      Subject: =?UTF-8?B?TGlicmFyeSAtIFXXXXXgU3VnZ2VzdGlvXXXXXXtaXR0ZWQgb24gTFNVIExXXXXXcm1z?=
      To: <webmaster@school.edu>
      X-PHP-Originating-Script: 0:class-phpmailer.php
      Date: Mon, 16 Nov 2015 03:15:40 +0000
      From: School Web <webmaster@school.edu>
      Message-ID: <056fdb4d7f0283a31dff135fe202c159@www.school.edu>
      X-Priority: 3
      X-Mailer: PHPMailer 5.2.10 (https://github.com/PHPMailer/PHPMailer/)
      Reply-To: <webmaster@school.edu>
      MIME-Version: 1.0
      Return-Path: webmaster@school.edu
      X-OriginalArrivalTime: 16 Nov 2015 03:15:40.0590 (UTC) FILETIME=[126F9CE0:01D1201D]
      X-MS-Exchange-Organization-AuthSource: email.school.edu
      X-MS-Exchange-Organization-AuthAs: Anonymous
      X-MS-Exchange-Organization-PRD: school.edu
      X-MS-Exchange-Organization-SenderIdResult: Pass
      Received-SPF: Pass (email.school.edu: domain of webmaster@school.edu
       designates XXX.XXX.XXX.XXX as permitted sender) receiver=email.school.edu;
       client-ip=XXX.XXX.XXX.XXX; helo=smtp.school.edu;
      Content-type: multipart/alternative;
          boundary="B_3530511021_187771850"
      
      > This message is in MIME format. Since your mail reader does not understand
      this format, some or all of this message may not be legible.
      
      --B_3530511021_187771850
      Content-type: text/plain;
          charset="UTF-8"
      Content-transfer-encoding: 7bit
      
      Affiliation:<=strong> XXXXXX Student 
      Comments: 1. I would feel a lot safer if, after a certain tim=, we would have to swipe our IDs to have access into the building. 
      <=r/>2. I wish the undergrads did not have access to our classrooms or our l=brary, especially during finals season. 
      
      3. I would appreciate i= if the library would allow us to have the study rooms for more than 3 hou=s IF all of the other study rooms are not full. I don\'t see the rationale =ehind kicking us out when there is no one else waiting for the room and th=re are 6  other empty ones not being used... 
      
      --B_3530511021_187771850
      Content-type: text/html;
          charset="UTF-8"
      Content-transfer-encoding: quoted-printable
      
      <html>
      <head>
      <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
      </head>
      <body>
      <table cellspacing=3D"0" style=3D"font-size:12px;line-height:135%; border-b=3Dtto=
      m:1px solid #dddddd;">
      <tbody>
      <tr style=3D"background-color:#eeeeee;">
      <th style=3D"text-align:left;color:=3D444444;padding:7px 9px;border-top:1px sol=
      id #dddddd">
      <strong>Affiliation:&lt;=3Dstrong&gt;</strong></th>
      <td style=3D"text-align:left;color:#444444;padding:7px 9px;bor=3Der-top:1px sol=
      id #dddddd">
      XXXXXX Student</td>
      </tr>
      <tr style=3D"background-color:#ffffff;">
      <th style=3D"text-align:left;color:=3D444444;padding:7px 9px;border-top:1px sol=
      id #dddddd">
      <strong>Comments:</st=3Dong></strong></th>
      <td style=3D"text-align:left;color:#444444;padding:7px 9px;border=3Dtop:1px sol=
      id #dddddd">
      1. I would feel a lot safer if, after a certain tim=3D, we would have to swip=
      e our IDs to have access into the building.
      <br>
      &lt;=3Dr/&gt;2. I wish the undergrads did not have access to our classrooms o=
      r our l=3Dbrary, especially during finals season.
      <br>
      <br>
      3. I would appreciate i=3D if the library would allow us to have the study ro=
      oms for more than 3 hou=3Ds IF all of the other study rooms are not full. I do=
      n\'t see the rationale =3Dehind kicking us out when there is no one else waitin=
      g for the room and th=3Dre are 6
       other empty ones not being used...</td>
      </tr>
      </tbody>
      </table>
      </body>
      </html>
      
      
      --B_3530511021_187771850--
      

    1 个回复
    最合适的回答,由SO网友:Hernan 整理而成

    我遇到了同样的问题,经过研究,我发现这是phpmailer类的一个bug。php。该错误显然是在WP 4.3.2中引入的。即使变更日志没有提到它,文件也被修改了。仅恢复wp-includes/class-phpmailer.php 到WP 4.3.1中包含的版本修复了该问题。

    该类本身也有一个版本,在本例中,我恢复为5.2.10。

    顺便说一下,我只在Exchange用户中看到了这个问题。但并不是所有人都报告了此事。

    如果您感兴趣,一些用户建议这是fixEOL()的问题,但我无法通过修补它来实现:Few chars getting replaced with '=' in mail content in wp_mail()

    相关推荐

    Register email as username

    我在Wordpress多站点中使用Wordpress 4.9.4,我需要允许用户使用其电子邮件地址作为用户名进行注册。查看代码,我发现阻止我完成的是ms函数。php有一个正则表达式过滤除a-z以外的其他字符的用户名,因此当电子邮件是用户名时,我会得到“用户名只能包含小写字母(a-z)和数字。”我在ms函数中更改了该正则表达式。php,它工作得很好。现在我的问题是,我不想每次更新wordpress时都重新编码wpmu\\u validate\\u user\\u signup函数。在这个问题上有什么好的做法