We have a PHP site that automatically sends emails to customers. The emails contain several PDF attachments. The emails are sent with help of Mail_Mime library.
Some customers complain that they receive corrupted emails. Only the subject line and the attachments list can be read, but the message body is empty and the attachments cannot be open, because they are zero-sized.
It seems that affected are only users who use Outlook with Exchange (not sure whether the presence of Forefront protection matters).
The users say that they never had problems with receiving PDF attachments before. They also have no problem with receiving them after we manually forward the emails to them.
I tried to reproduce the bug myself in Outlook 2010 (without Exchange) but with no luck. I also tried to send an email from the site to a friend who has Exchange, but the problem didn't reproduce.
The emails which are automatically sent to users are at the same time sent to my own address. I have no problem reading them in my Thunderbird which gets them via POP.
This is what I see if I choose to 'View Source' in Thunderbird (I dropped away some irrelevant (I hope) content):
From - Wed Jun 08 13:41:49 2011
X-Account-Key: account2
X-UIDL: '6m"!Z+&!!8k4"!E*a"!
X-Mozilla-Status: 0001
X-Mozilla-Status2: 10000000
X-Mozilla-Keys:
Return-Path: <zzz@zzz.zzz>
X-Original-To: zzz@zzz.zzz
Delivered-To: zzz@zzz.zzz.zzz
Received: from zzz.zzz.zzz (zzz.zzz.zzz [111.111.111.111])
by zzz.zzz.zzz (Postfix) with ESMTP id 20BAE12D5BFC
for <zzz@zzz.zzz>; Wed, 8 Jun 2011 13:41:42 +0400 (MSD)
Received: by zzz.zzz.zzz (Postfix, from userid 1002)
id A806F87402C; Wed, 8 Jun 2011 05:41:41 -0400 (EDT)
To: xxx@xxx.xxx
Subject: Subject line goes here
MIME-Version: 1.0
From: "My Company" <zzz@zzz.zzz>
Content-Type: multipart/mixed; boundary="=_483486e551ad38b22fdb6086892ae1d8"
Message-Id: <20110608094141.A806F87402C@zzz@zzz.zzz>
Date: Wed, 8 Jun 2011 05:41:41 -0400 (EDT)
X-UIDL: '6m"!Z+&!!8k4"!E*a"!
X-Antivirus: avast! (VPS 110607-1, 08.06.2011), Inbound message
X-Antivirus-Status: Clean
--=_483486e551ad38b22fdb6086892ae1d8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Message text goes here
--=_483486e551ad38b22fdb6086892ae1d8
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="File name of the attachment #1 goes here.pdf"
Attachment body goes here
--=_483486e551ad38b22fdb6086892ae1d8
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="File name of the attachment #2 goes here.pdf"
Attachment body goes here
--=_483486e551ad38b22fdb6086892ae1d8
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="File name of the attachment #3 goes here.pdf"
Attachment body goes here
--=_483486e551ad38b22fdb6086892ae1d8--
And this is how the forwarded emails (which cause no problems) look like:
From - Wed Jun 08 14:01:49 2011
X-Account-Key: account2
X-UIDL: <6^!!YZb"!&W`"!`c5!!
X-Mozilla-Status: 0011
X-Mozilla-Status2: 10000000
X-Mozilla-Keys:
Return-Path: <zzz@zzz.zzz>
X-Original-To: zzz@zzz.zzz
Delivered-To: zzz@zzz.zzz
Received: from zzz (zzz.zzz [111.111.111.111])
by zzz.zzz.zzz (Postfix) with ESMTP
id 5650212D5BFF; Wed, 8 Jun 2011 14:01:25 +0400 (MSD)
From: "Sender Name" <zzz@zzz.zzz>
To: "'Receiver Name'" <xxx@xxx.xxx>
References: <yyy@yyy.yyy>
In-Reply-To: <yyy@yyy.yyy>
Subject: RE: Subject goes here
Date: Wed, 8 Jun 2011 14:01:24 +0400
Message-ID: <040001cc25c3$069a55d0$13cf0170$@com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0401_01CC25E4.8DABF5D0"
X-Mailer: Microsoft Office Outlook 12.0
Content-Language: en-us
Thread-Index: AcwlwMErYQSr/NBaQnKuOFG6ak7f6AAAby/g
X-UIDL: <6^!!YZb"!&W`"!`c5!!
X-Antivirus: avast! (VPS 110607-1, 08.06.2011), Inbound message
X-Antivirus-Status: Clean
This is a multipart message in MIME format.
------=_NextPart_000_0401_01CC25E4.8DABF5D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Message text goes here
------=_NextPart_000_0401_01CC25E4.8DABF5D0
Content-Type: application/pdf;
name="File name of the attachment #1 goes here.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="File name of the attachment #1 goes here.pdf"
Attachment body goes here
------=_NextPart_000_0401_01CC25E4.8DABF5D0
Content-Type: application/pdf;
name="File name of the attachment #2 goes here.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="File name of the attachment #2 goes here.pdf"
Attachment body goes here
------=_NextPart_000_0401_01CC25E4.8DABF5D0
Content-Type: application/pdf;
name="File name of the attachment #3 goes here.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="File name of the attachment #3 goes here.pdf"
Attachment body goes here
------=_NextPart_000_0401_01CC25E4.8DABF5D0--
I'm not sure, though, that this is the message format that matters. The thing is that these two messages were sent from different places on Earth (one from America, the other from Europe), so they took different paths to the recipient.
Hope that anyone can shed the light to this mystery.