传递状态通知,无效标头:错误的MIME

由商店Web应用程序生成的每封电子邮件都将返回: 传递状态通知,无效标头:错误的MIME

从查看错误信息看起来好像是抱怨电子邮件中的HTML,虽然在查看源代码时看起来不是什么问题。

Your message WAS SUCCESSFULLY RELAYED to: <[email protected]> This delivery report was generated by the program amavisd-new at host example.com. Our internal reference code for your message is 20971-09/NNjaWqvFY5Qg INVALID HEADER: BAD MIME HEADER SECTION OR BAD MIME STRUCTURE MIME error: error: couldn't parse head; error near:; Return ID: 1; Return Date: 11/09/2011 Return-Path: <[email protected]> From: =?UTF-8?B?WW91ciBTdG9yZQ==?=<[email protected]> Message-ID: <[email protected]> X-Mailer: PHP/5.3.4 Subject: =?UTF-8?B?WW91ciBTdG9yZSAtIFJldHVybiBVcGRhdGUgMQ==?= dsn_status Reporting-MTA: dns; example.com Received-From-MTA: smtp; example.com ([127.0.0.1]) Arrival-Date: Sun, 11 Sep 2011 18:54:40 +0100 (BST) Original-Recipient: rfc822;[email protected] Final-Recipient: rfc822;[email protected] Action: delayed Status: 2.0.0 Diagnostic-Code: smtp; 250 2.6.0 Bad message, but will be delivered anyway Last-Attempt-Date: Sun, 11 Sep 2011 18:54:40 +0100 (BST) Final-Log-ID: 20971-09/NNjaWqvFY5Qg header Return-Path: <[email protected]> Received: from example.com (cpc10-donc9-2-0-cust122.barn.cable.virginmedia.com [94.171.174.123]) by example.com (iRedMail) with ESMTPSA id A84BE5E099 for <[email protected]>; Sun, 11 Sep 2011 18:54:40 +0100 (BST) To: [email protected] Subject: =?UTF-8?B?WW91ciBTdG9yZSAtIFJldHVybiBVcGRhdGUgMQ==?= X-PHP-Originating-Script: 0:mail.php MIME-Version: 1.0 Date: Sun, 11 Sep 2011 17:54:40 +0000 From: =?UTF-8?B?WW91ciBTdG9yZQ==?=<[email protected]> Reply-To: Your Store<[email protected]> X-Mailer: PHP/5.3.4 Content-Type: multipart/related; boundary="----=_NextPart_b45f3c386576f1955bb5338634f5047f" Message-Id: <[email protected]> 

电子邮件导致上述错误的消息源:

 Return-Path: <[email protected]> Delivered-To: [email protected] Received: from localhost (localhost.localdomain [127.0.0.1]) by example.com (iRedMail) with ESMTP id 4C03E5E09C for <[email protected]>; Sun, 11 Sep 2011 18:54:41 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=example.com; h=message-id:content-type:content-type:x-mailer:reply-to:from :from:date:date:mime-version:subject:subject:to; s=dkim; t= 1315763680; x=1316627680; bh=18GKmsQjF86uG/PbhhDg2FY9o3H6chH8XZo 4VFFN45k=; b=g4TbDzU8pWzeX7CdmCI/Sq8JjtPM6wTQIMqQ7dRclE0XqCVgEZ4 OeQtpR1zApiV31RLu87k9QQF6a4mvCmr1N31auiq4u+AfxFW3DujSvDz5h3lSSf4 vPVgHwzEBQbaue9VeZ0nPmHhrrJWojv5iMlfjUKIdNJkBuP9BF3plVgA= X-Quarantine-ID: <NNjaWqvFY5Qg> X-Amavis-Modified: Mail body modified (using disclaimer) - example.com X-Virus-Scanned: by amavisd at example.com X-Amavis-Alert: BAD HEADER SECTION, MIME error: error: couldn't parse head; error near:; Return ID: 1; Return Date: 11/09/2011 X-Spam-Flag: NO X-Spam-Score: -6.697 X-Spam-Level: X-Spam-Status: No, score=-6.697 tagged_above=-999 required=6.31 tests=[ALL_TRUSTED=-10, AWL=-1.381, FROM_EXCESS_BASE64=1.984, HTML_MESSAGE=0.001, MISSING_MIME_HB_SEP=2.699] autolearn=disabled Received: from example.com ([127.0.0.1]) by localhost (example.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NNjaWqvFY5Qg for <[email protected]>; Sun, 11 Sep 2011 18:54:40 +0100 (BST) Received: from example.com (cpc10-donc9-2-0-cust122.barn.cable.virginmedia.com [94.171.174.123]) by example.com (iRedMail) with ESMTPSA id A84BE5E099 for <[email protected]>; Sun, 11 Sep 2011 18:54:40 +0100 (BST) To: [email protected] Subject: =?UTF-8?B?WW91ciBTdG9yZSAtIFJldHVybiBVcGRhdGUgMQ==?= X-PHP-Originating-Script: 0:mail.php MIME-Version: 1.0 Date: Sun, 11 Sep 2011 17:54:40 +0000 From: =?UTF-8?B?WW91ciBTdG9yZQ==?=<[email protected]> Reply-To: Your Store<[email protected]> X-Mailer: PHP/5.3.4 Content-Type: multipart/related; boundary="----=_NextPart_b45f3c386576f1955bb5338634f5047f" Message-Id: <[email protected]> ------=_NextPart_b45f3c386576f1955bb5338634f5047f Content-Type: multipart/alternative; boundary="----=_NextPart_b45f3c386576f1955bb5338634f5047f_alt" ------=_NextPart_b45f3c386576f1955bb5338634f5047f_alt Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Return ID: 1 Return Date: 11/09/2011 Your return has been updated to the following status: Complete The comments for your return are: gsfdgf g fdgfdgfdgfd Please reply to this email if you have any questions. ------=_NextPart_b45f3c386576f1955bb5338634f5047f_alt Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 8bit <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Your Store</title> <style type="text/css"> v\:* { behavior: url(#default#VML); display:inline-block; } </style> </head> <body bgcolor="#f5f5f5" style="margin:0; padding:0; background-color:#f5f5f5; color:#333333; font-size:12px; font-family:Helvetica, Arial, sans-serif; line-height:18px; width:100% !important;"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"> <table width="660" border="0" cellspacing="0" cellpadding="0"> <td id="main-bg" align="center" valign="middle" background="http://www.example.com/default/image/mail/body-repeat-white.gif" style="margin:0 auto; background-image:url('http://www.example.com/default/image/mail/body-repeat-white.gif'); background-repeat:repeat-y; width:660px; postion:relative;"> <!--[if gte mso 9]> <v:background xmlns:v="urn:schemas-microsoft-com:vml"> <v:fill type="solid" src="http://www.example.com/default/image/mail/body-repeat-white.gif" /> </v:background> <![endif]--> <table width="580" border="0" cellspacing="0" cellpadding="0" style="overflow:hidden; table-layout:fixed; width:580px; word-wrap:break-word;"> <tr> <td id="header-bg" bgcolor="#515151" background="http://www.example.com/default/image/mail/head-bg.jpg" style="background-image:url("http://www.example.com/default/image/mail/head-bg.jpg"); background-repeat:no-repeat; background-color:#434343; font-size:30px; color:#ffffff;"> <table border="0" cellspacing="0" cellpadding="20"> <tr> <td> <a href="http://localhost/opencart-1.5/" title="Your Store" style="display:block;padding-left:10px;"> <img src="http://localhost/opencart-1.5/image/data/logo.png" alt="Your Store" style="display:block; border:none;" /> </a> </td> </tr> </table> </td> </tr> <tr> <td bgcolor="#ffffff" style="background-color:#ffffff; padding:5px 25px 0; font-size:12px; font-family:Helvetica, Arial, sans-serif; line-height:18px;text-align:left;"> <h1 style="color:#333333; font-size:18px; font-weight:bold; line-height:28px; margin:10px 0;">Your Store</h1> <p> <strong>Return ID:</strong> 1<br /> <strong>Return Date:</strong> 11/09/2011 </p> <p>Your return has been updated to the following status: <strong>Complete</strong></p> <p><strong>The comments for your return are:</strong>gsfdgf<br /><br /><br />g<br />fdgfdgfdgfd</p> <p>Please reply to this email if you have any questions.</p> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <style type="text/css"> p { font-size:12px; font-family:Helvetica, Arial, sans-serif; line-height:18px; margin:4px 0 12px; } strong { font-weight:bold; } a { color:#28b0ec; text-decoration:none; border:none; } a:hover { color:#28b0ec; text-decoration:underline; cursor:pointer; } a:visited { text-decoration:underline; } </style> </body> </html> ------=_NextPart_b45f3c386576f1955bb5338634f5047f_alt-- ------=_NextPart_b45f3c386576f1955bb5338634f5047f-- 

消息或MIME头与消息内容之间必须有一个空行:

 ------=_NextPart_b45f3c386576f1955bb5338634f5047f_alt Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Return ID: 1 Return Date: 11/09/2011 

在这里你需要在Content-Transfer-Encoding: 8bitReturn ID: 1之间有一个空行。

如果Return IDReturn Date应该是标题,则它们在语法上是错误的。 标题名称中的标题不得包含空格。 有效的标题将是Return-IdReturn-Date

它看起来也可能是8位的MIME Con​​tent-Transfer-Encoding声明,而大多数文本types的内容通常被声明为7bit。

 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit