Discussion:
Zend_Mail and Microsoft Exchange Servers
Justin Hendrickson
2007-12-05 21:00:07 UTC
Permalink
Has anyone experienced problems with sending attachment with Zend_Mail
to MS Exchange servers? I consistently get emails from them saying the
attachment on the email I sent was corrupt.

I initially thought the PDF was corrupt, so I started saving a copy of
it before emailing it. The PDF opens fine, and weirder yet, sending
the attachment with my email client (Evolution) works fine, no
corruption issues.

I'd test this myself, but I don't have an MS Exchange server to run
the tests on. I might be able to send a couple more emails to one of
the users, but they're typically too busy to expect any kind of
reasonable turn around time.
Cameron Laird
2007-12-05 21:01:17 UTC
Permalink
There have indeed been issues in this area; perhaps there still
are. What release of Zend_Mail sources do you use?

-----Original Message-----
From: Justin Hendrickson [mailto:justin.hendrickson-***@public.gmane.org]
Sent: Wed 12/5/2007 3:00 PM
To: fw-formats-***@public.gmane.org
Subject: [fw-formats] Zend_Mail and Microsoft Exchange Servers

Has anyone experienced problems with sending attachment with Zend_Mail
to MS Exchange servers? I consistently get emails from them saying the
attachment on the email I sent was corrupt.

I initially thought the PDF was corrupt, so I started saving a copy of
it before emailing it. The PDF opens fine, and weirder yet, sending
the attachment with my email client (Evolution) works fine, no
corruption issues.

I'd test this myself, but I don't have an MS Exchange server to run
the tests on. I might be able to send a couple more emails to one of
the users, but they're typically too busy to expect any kind of
reasonable turn around time.
Justin Hendrickson
2007-12-05 21:45:57 UTC
Permalink
This project is a bit old and never got upgraded, so I'm using ZF 0.7.0.

I'm going retry sending an email with an attachment to the client
using 0.7.0 and 1.0.3 and see if there's any difference.
Post by Cameron Laird
There have indeed been issues in this area; perhaps there still
are. What release of Zend_Mail sources do you use?
-----Original Message-----
Sent: Wed 12/5/2007 3:00 PM
Subject: [fw-formats] Zend_Mail and Microsoft Exchange Servers
Has anyone experienced problems with sending attachment with Zend_Mail
to MS Exchange servers? I consistently get emails from them saying the
attachment on the email I sent was corrupt.
I initially thought the PDF was corrupt, so I started saving a copy of
it before emailing it. The PDF opens fine, and weirder yet, sending
the attachment with my email client (Evolution) works fine, no
corruption issues.
I'd test this myself, but I don't have an MS Exchange server to run
the tests on. I might be able to send a couple more emails to one of
the users, but they're typically too busy to expect any kind of
reasonable turn around time.
Justin Hendrickson
2007-12-05 21:53:01 UTC
Permalink
I just confirmed that Zend_Mail in 0.7.0 and 1.0.2 both failed to send
the attachment correctly.

I'm looking at raw copies of each email and they look mostly identical
(minus timestamps, ids, mime boundaries and such).

I'm going to create a new test with 1.0.3 in a minute here.
Post by Justin Hendrickson
This project is a bit old and never got upgraded, so I'm using ZF 0.7.0.
I'm going retry sending an email with an attachment to the client
using 0.7.0 and 1.0.3 and see if there's any difference.
Post by Cameron Laird
There have indeed been issues in this area; perhaps there still
are. What release of Zend_Mail sources do you use?
-----Original Message-----
Sent: Wed 12/5/2007 3:00 PM
Subject: [fw-formats] Zend_Mail and Microsoft Exchange Servers
Has anyone experienced problems with sending attachment with Zend_Mail
to MS Exchange servers? I consistently get emails from them saying the
attachment on the email I sent was corrupt.
I initially thought the PDF was corrupt, so I started saving a copy of
it before emailing it. The PDF opens fine, and weirder yet, sending
the attachment with my email client (Evolution) works fine, no
corruption issues.
I'd test this myself, but I don't have an MS Exchange server to run
the tests on. I might be able to send a couple more emails to one of
the users, but they're typically too busy to expect any kind of
reasonable turn around time.
Justin Hendrickson
2007-12-06 04:36:52 UTC
Permalink
I tested out Zend_Mail from 1.0.3 and the trunk and got the same result.

I sent myself a copy of each mail, saved each of their raw source, and
diff'ed them. 0.7.0, 1.0.2 and 1.0.3 are pretty much all the same,
excluding the previously mentioned differences.

I'm going to have to wait until tomorrow to send out another batch of
tests, unless we can find someone with an MS Exchange server tonight.

In the mean time, I'm going to create a set of test scripts that use
Zend_Mail 0.7.0, 1.0.2, 1.0.3, trunk, as well as the latest version of
PHPMailer and PEAR::Mail. Hopefully one of those will work and we'll
have something to look at.
Post by Justin Hendrickson
I just confirmed that Zend_Mail in 0.7.0 and 1.0.2 both failed to send
the attachment correctly.
I'm looking at raw copies of each email and they look mostly identical
(minus timestamps, ids, mime boundaries and such).
I'm going to create a new test with 1.0.3 in a minute here.
Post by Justin Hendrickson
This project is a bit old and never got upgraded, so I'm using ZF 0.7.0.
I'm going retry sending an email with an attachment to the client
using 0.7.0 and 1.0.3 and see if there's any difference.
Post by Cameron Laird
There have indeed been issues in this area; perhaps there still
are. What release of Zend_Mail sources do you use?
-----Original Message-----
Sent: Wed 12/5/2007 3:00 PM
Subject: [fw-formats] Zend_Mail and Microsoft Exchange Servers
Has anyone experienced problems with sending attachment with Zend_Mail
to MS Exchange servers? I consistently get emails from them saying the
attachment on the email I sent was corrupt.
I initially thought the PDF was corrupt, so I started saving a copy of
it before emailing it. The PDF opens fine, and weirder yet, sending
the attachment with my email client (Evolution) works fine, no
corruption issues.
I'd test this myself, but I don't have an MS Exchange server to run
the tests on. I might be able to send a couple more emails to one of
the users, but they're typically too busy to expect any kind of
reasonable turn around time.
Eric Coleman
2007-12-06 05:31:00 UTC
Permalink
Justin,

What happens if you diff the exchange attachment vs. the one you send
yourself (which, obviously doesn't go through exchange?)

Maybe figuring out what's happening with the attachment might help
figure out where it is? Also, does it happen with any other kinds of
attachments? Have you tried with like a zip or tarball, or maybe a
word document of some sort?

Regards,
Eric
Post by Justin Hendrickson
I tested out Zend_Mail from 1.0.3 and the trunk and got the same result.
I sent myself a copy of each mail, saved each of their raw source, and
diff'ed them. 0.7.0, 1.0.2 and 1.0.3 are pretty much all the same,
excluding the previously mentioned differences.
I'm going to have to wait until tomorrow to send out another batch of
tests, unless we can find someone with an MS Exchange server tonight.
In the mean time, I'm going to create a set of test scripts that use
Zend_Mail 0.7.0, 1.0.2, 1.0.3, trunk, as well as the latest version of
PHPMailer and PEAR::Mail. Hopefully one of those will work and we'll
have something to look at.
Post by Justin Hendrickson
I just confirmed that Zend_Mail in 0.7.0 and 1.0.2 both failed to send
the attachment correctly.
I'm looking at raw copies of each email and they look mostly
identical
(minus timestamps, ids, mime boundaries and such).
I'm going to create a new test with 1.0.3 in a minute here.
Post by Justin Hendrickson
This project is a bit old and never got upgraded, so I'm using ZF 0.7.0.
I'm going retry sending an email with an attachment to the client
using 0.7.0 and 1.0.3 and see if there's any difference.
Post by Cameron Laird
There have indeed been issues in this area; perhaps there still
are. What release of Zend_Mail sources do you use?
-----Original Message-----
Sent: Wed 12/5/2007 3:00 PM
Subject: [fw-formats] Zend_Mail and Microsoft Exchange Servers
Has anyone experienced problems with sending attachment with Zend_Mail
to MS Exchange servers? I consistently get emails from them
saying the
attachment on the email I sent was corrupt.
I initially thought the PDF was corrupt, so I started saving a copy of
it before emailing it. The PDF opens fine, and weirder yet, sending
the attachment with my email client (Evolution) works fine, no
corruption issues.
I'd test this myself, but I don't have an MS Exchange server to run
the tests on. I might be able to send a couple more emails to one of
the users, but they're typically too busy to expect any kind of
reasonable turn around time.
Marco Kaiser
2007-12-06 09:33:53 UTC
Permalink
Hi,

i have a bunch of Exchange servers here, so please provide me a set of test
scripts to check the issue.

-- Marco
Post by Cameron Laird
-----Original Message-----
Sent: Thursday, December 06, 2007 6:31 AM
To: Justin Hendrickson
Subject: Re: [fw-formats] Zend_Mail and Microsoft Exchange Servers
Justin,
What happens if you diff the exchange attachment vs. the one you send
yourself (which, obviously doesn't go through exchange?)
Maybe figuring out what's happening with the attachment might help
figure out where it is? Also, does it happen with any other kinds of
attachments? Have you tried with like a zip or tarball, or maybe a
word document of some sort?
Regards,
Eric
Post by Justin Hendrickson
I tested out Zend_Mail from 1.0.3 and the trunk and got the same result.
I sent myself a copy of each mail, saved each of their raw source,
and
Post by Justin Hendrickson
diff'ed them. 0.7.0, 1.0.2 and 1.0.3 are pretty much all the same,
excluding the previously mentioned differences.
I'm going to have to wait until tomorrow to send out another batch of
tests, unless we can find someone with an MS Exchange server tonight.
In the mean time, I'm going to create a set of test scripts that use
Zend_Mail 0.7.0, 1.0.2, 1.0.3, trunk, as well as the latest version
of
Post by Justin Hendrickson
PHPMailer and PEAR::Mail. Hopefully one of those will work and we'll
have something to look at.
On Dec 5, 2007 3:53 PM, Justin Hendrickson
Post by Justin Hendrickson
I just confirmed that Zend_Mail in 0.7.0 and 1.0.2 both failed to send
the attachment correctly.
I'm looking at raw copies of each email and they look mostly identical
(minus timestamps, ids, mime boundaries and such).
I'm going to create a new test with 1.0.3 in a minute here.
On Dec 5, 2007 3:45 PM, Justin Hendrickson
Post by Justin Hendrickson
This project is a bit old and never got upgraded, so I'm using ZF 0.7.0.
I'm going retry sending an email with an attachment to the client
using 0.7.0 and 1.0.3 and see if there's any difference.
Post by Cameron Laird
There have indeed been issues in this area; perhaps there still
are. What release of Zend_Mail sources do you use?
-----Original Message-----
Sent: Wed 12/5/2007 3:00 PM
Subject: [fw-formats] Zend_Mail and Microsoft Exchange Servers
Has anyone experienced problems with sending attachment with Zend_Mail
to MS Exchange servers? I consistently get emails from them saying the
attachment on the email I sent was corrupt.
I initially thought the PDF was corrupt, so I started saving a copy of
it before emailing it. The PDF opens fine, and weirder yet,
sending
Post by Justin Hendrickson
Post by Justin Hendrickson
Post by Justin Hendrickson
Post by Cameron Laird
the attachment with my email client (Evolution) works fine, no
corruption issues.
I'd test this myself, but I don't have an MS Exchange server to
run
Post by Justin Hendrickson
Post by Justin Hendrickson
Post by Justin Hendrickson
Post by Cameron Laird
the tests on. I might be able to send a couple more emails to one of
the users, but they're typically too busy to expect any kind of
reasonable turn around time.
Justin Hendrickson
2007-12-06 16:03:49 UTC
Permalink
Unfortunately, all the people that having problems with attachments
are also Outlook 2003 users. In order to get the full source of an
email with Outlook 2003, you have to make a registry change. Normally
I'd just call them up and do some troubleshooting with them, but
they're not direct customers (these are invoices PDF's I'm sending
them) and they're very busy, so they're not very eager to assist me.

I just sent off my test scripts to Eric Coleman, so hopefully he can
reproduce the bug with those and we can identify the bug.
Post by Eric Coleman
Justin,
What happens if you diff the exchange attachment vs. the one you send
yourself (which, obviously doesn't go through exchange?)
Maybe figuring out what's happening with the attachment might help
figure out where it is? Also, does it happen with any other kinds of
attachments? Have you tried with like a zip or tarball, or maybe a
word document of some sort?
Regards,
Eric
Post by Justin Hendrickson
I tested out Zend_Mail from 1.0.3 and the trunk and got the same result.
I sent myself a copy of each mail, saved each of their raw source, and
diff'ed them. 0.7.0, 1.0.2 and 1.0.3 are pretty much all the same,
excluding the previously mentioned differences.
I'm going to have to wait until tomorrow to send out another batch of
tests, unless we can find someone with an MS Exchange server tonight.
In the mean time, I'm going to create a set of test scripts that use
Zend_Mail 0.7.0, 1.0.2, 1.0.3, trunk, as well as the latest version of
PHPMailer and PEAR::Mail. Hopefully one of those will work and we'll
have something to look at.
Post by Justin Hendrickson
I just confirmed that Zend_Mail in 0.7.0 and 1.0.2 both failed to send
the attachment correctly.
I'm looking at raw copies of each email and they look mostly identical
(minus timestamps, ids, mime boundaries and such).
I'm going to create a new test with 1.0.3 in a minute here.
Post by Justin Hendrickson
This project is a bit old and never got upgraded, so I'm using ZF 0.7.0.
I'm going retry sending an email with an attachment to the client
using 0.7.0 and 1.0.3 and see if there's any difference.
Post by Cameron Laird
There have indeed been issues in this area; perhaps there still
are. What release of Zend_Mail sources do you use?
-----Original Message-----
Sent: Wed 12/5/2007 3:00 PM
Subject: [fw-formats] Zend_Mail and Microsoft Exchange Servers
Has anyone experienced problems with sending attachment with Zend_Mail
to MS Exchange servers? I consistently get emails from them saying the
attachment on the email I sent was corrupt.
I initially thought the PDF was corrupt, so I started saving a copy of
it before emailing it. The PDF opens fine, and weirder yet, sending
the attachment with my email client (Evolution) works fine, no
corruption issues.
I'd test this myself, but I don't have an MS Exchange server to run
the tests on. I might be able to send a couple more emails to one of
the users, but they're typically too busy to expect any kind of
reasonable turn around time.
Justin Hendrickson
2007-12-06 17:17:59 UTC
Permalink
I just sent out another batch of tests and all versions (0.7.0, 1.0.2,
1.0.3, trunk) of Zend_Mail had bad attachments. I also sent two tests
using PEAR::Mail and PHPMailer v.2.0.0 and those attachments worked.

On Dec 6, 2007 10:03 AM, Justin Hendrickson
Post by Justin Hendrickson
Unfortunately, all the people that having problems with attachments
are also Outlook 2003 users. In order to get the full source of an
email with Outlook 2003, you have to make a registry change. Normally
I'd just call them up and do some troubleshooting with them, but
they're not direct customers (these are invoices PDF's I'm sending
them) and they're very busy, so they're not very eager to assist me.
I just sent off my test scripts to Eric Coleman, so hopefully he can
reproduce the bug with those and we can identify the bug.
Post by Eric Coleman
Justin,
What happens if you diff the exchange attachment vs. the one you send
yourself (which, obviously doesn't go through exchange?)
Maybe figuring out what's happening with the attachment might help
figure out where it is? Also, does it happen with any other kinds of
attachments? Have you tried with like a zip or tarball, or maybe a
word document of some sort?
Regards,
Eric
Post by Justin Hendrickson
I tested out Zend_Mail from 1.0.3 and the trunk and got the same result.
I sent myself a copy of each mail, saved each of their raw source, and
diff'ed them. 0.7.0, 1.0.2 and 1.0.3 are pretty much all the same,
excluding the previously mentioned differences.
I'm going to have to wait until tomorrow to send out another batch of
tests, unless we can find someone with an MS Exchange server tonight.
In the mean time, I'm going to create a set of test scripts that use
Zend_Mail 0.7.0, 1.0.2, 1.0.3, trunk, as well as the latest version of
PHPMailer and PEAR::Mail. Hopefully one of those will work and we'll
have something to look at.
Post by Justin Hendrickson
I just confirmed that Zend_Mail in 0.7.0 and 1.0.2 both failed to send
the attachment correctly.
I'm looking at raw copies of each email and they look mostly identical
(minus timestamps, ids, mime boundaries and such).
I'm going to create a new test with 1.0.3 in a minute here.
Post by Justin Hendrickson
This project is a bit old and never got upgraded, so I'm using ZF 0.7.0.
I'm going retry sending an email with an attachment to the client
using 0.7.0 and 1.0.3 and see if there's any difference.
Post by Cameron Laird
There have indeed been issues in this area; perhaps there still
are. What release of Zend_Mail sources do you use?
-----Original Message-----
Sent: Wed 12/5/2007 3:00 PM
Subject: [fw-formats] Zend_Mail and Microsoft Exchange Servers
Has anyone experienced problems with sending attachment with Zend_Mail
to MS Exchange servers? I consistently get emails from them saying the
attachment on the email I sent was corrupt.
I initially thought the PDF was corrupt, so I started saving a copy of
it before emailing it. The PDF opens fine, and weirder yet, sending
the attachment with my email client (Evolution) works fine, no
corruption issues.
I'd test this myself, but I don't have an MS Exchange server to run
the tests on. I might be able to send a couple more emails to one of
the users, but they're typically too busy to expect any kind of
reasonable turn around time.
Matthew Weier O'Phinney
2007-12-06 17:35:52 UTC
Permalink
Post by Justin Hendrickson
I just sent out another batch of tests and all versions (0.7.0, 1.0.2,
1.0.3, trunk) of Zend_Mail had bad attachments. I also sent two tests
using PEAR::Mail and PHPMailer v.2.0.0 and those attachments worked.
I just want to clarify:

* You're sending using Zend_Mail from a local server that is *NOT*
Exchange
* Client servers receiving the email *are* using Exchange

Is this correct?

If so, can you provide the full mail pieces with attachments as sent
both by Zend_Mail and either PEAR::Mail or PHPMailer? I would need to
see the full mail, including all mail headers, as it is sent. This can
be done by either creating a transport that simply captures and logs the
mail, or by sending to yourself and posting the received mail somewhere
I can look at it.

Also, please indicate which Zend_Mail transport you are using to send,
the OS you're on, and any options you are using to configure the
Zend_Mail and/or transport objects prior to sending (encoding, character
set, etc.)

Basically, I want to analyze the differences and determine what Exchange
may not be liking about the mails Zend_Mail generates.
Post by Justin Hendrickson
On Dec 6, 2007 10:03 AM, Justin Hendrickson
Post by Justin Hendrickson
Unfortunately, all the people that having problems with attachments
are also Outlook 2003 users. In order to get the full source of an
email with Outlook 2003, you have to make a registry change. Normally
I'd just call them up and do some troubleshooting with them, but
they're not direct customers (these are invoices PDF's I'm sending
them) and they're very busy, so they're not very eager to assist me.
I just sent off my test scripts to Eric Coleman, so hopefully he can
reproduce the bug with those and we can identify the bug.
Post by Eric Coleman
Justin,
What happens if you diff the exchange attachment vs. the one you send
yourself (which, obviously doesn't go through exchange?)
Maybe figuring out what's happening with the attachment might help
figure out where it is? Also, does it happen with any other kinds of
attachments? Have you tried with like a zip or tarball, or maybe a
word document of some sort?
Regards,
Eric
Post by Justin Hendrickson
I tested out Zend_Mail from 1.0.3 and the trunk and got the same result.
I sent myself a copy of each mail, saved each of their raw source, and
diff'ed them. 0.7.0, 1.0.2 and 1.0.3 are pretty much all the same,
excluding the previously mentioned differences.
I'm going to have to wait until tomorrow to send out another batch of
tests, unless we can find someone with an MS Exchange server tonight.
In the mean time, I'm going to create a set of test scripts that use
Zend_Mail 0.7.0, 1.0.2, 1.0.3, trunk, as well as the latest version of
PHPMailer and PEAR::Mail. Hopefully one of those will work and we'll
have something to look at.
Post by Justin Hendrickson
I just confirmed that Zend_Mail in 0.7.0 and 1.0.2 both failed to send
the attachment correctly.
I'm looking at raw copies of each email and they look mostly identical
(minus timestamps, ids, mime boundaries and such).
I'm going to create a new test with 1.0.3 in a minute here.
Post by Justin Hendrickson
This project is a bit old and never got upgraded, so I'm using ZF 0.7.0.
I'm going retry sending an email with an attachment to the client
using 0.7.0 and 1.0.3 and see if there's any difference.
Post by Cameron Laird
There have indeed been issues in this area; perhaps there still
are. What release of Zend_Mail sources do you use?
-----Original Message-----
Sent: Wed 12/5/2007 3:00 PM
Subject: [fw-formats] Zend_Mail and Microsoft Exchange Servers
Has anyone experienced problems with sending attachment with Zend_Mail
to MS Exchange servers? I consistently get emails from them saying the
attachment on the email I sent was corrupt.
I initially thought the PDF was corrupt, so I started saving a copy of
it before emailing it. The PDF opens fine, and weirder yet, sending
the attachment with my email client (Evolution) works fine, no
corruption issues.
I'd test this myself, but I don't have an MS Exchange server to run
the tests on. I might be able to send a couple more emails to one of
the users, but they're typically too busy to expect any kind of
reasonable turn around time.
--
Matthew Weier O'Phinney
PHP Developer | matthew-C1q0ot2/***@public.gmane.org
Zend - The PHP Company | http://www.zend.com/
Justin Hendrickson
2007-12-06 19:30:12 UTC
Permalink
Post by Matthew Weier O'Phinney
* You're sending using Zend_Mail from a local server that is *NOT*
Exchange
Correct.
Post by Matthew Weier O'Phinney
* Client servers receiving the email *are* using Exchange
Correct.
Post by Matthew Weier O'Phinney
If so, can you provide the full mail pieces with attachments as sent
both by Zend_Mail and either PEAR::Mail or PHPMailer? I would need to
see the full mail, including all mail headers, as it is sent. This can
be done by either creating a transport that simply captures and logs the
mail, or by sending to yourself and posting the received mail somewhere
I can look at it.
I've actually done this already. I have a set of test scripts designed
to send myself an email using a variety of libraries and versions. I
saved the raw source of each email to a file and compared them. It was
greek to me, but maybe you'll have a better idea. I've uploaded them
to http://djcricket.com/emails.tar.gz
Post by Matthew Weier O'Phinney
Also, please indicate which Zend_Mail transport you are using to send,
the OS you're on, and any options you are using to configure the
Zend_Mail and/or transport objects prior to sending (encoding, character
set, etc.)
Ubuntu 7.10, SMTP transport using Login authentication. The encoding
and character sets are the defaults.
Matthew Weier O'Phinney
2007-12-06 20:35:35 UTC
Permalink
Post by Justin Hendrickson
Post by Matthew Weier O'Phinney
* You're sending using Zend_Mail from a local server that is *NOT*
Exchange
Correct.
Post by Matthew Weier O'Phinney
* Client servers receiving the email *are* using Exchange
Correct.
Post by Matthew Weier O'Phinney
If so, can you provide the full mail pieces with attachments as sent
both by Zend_Mail and either PEAR::Mail or PHPMailer? I would need to
see the full mail, including all mail headers, as it is sent. This can
be done by either creating a transport that simply captures and logs the
mail, or by sending to yourself and posting the received mail somewhere
I can look at it.
I've actually done this already. I have a set of test scripts designed
to send myself an email using a variety of libraries and versions. I
saved the raw source of each email to a file and compared them. It was
greek to me, but maybe you'll have a better idea. I've uploaded them
to http://djcricket.com/emails.tar.gz
Post by Matthew Weier O'Phinney
Also, please indicate which Zend_Mail transport you are using to send,
the OS you're on, and any options you are using to configure the
Zend_Mail and/or transport objects prior to sending (encoding, character
set, etc.)
Ubuntu 7.10, SMTP transport using Login authentication. The encoding
and character sets are the defaults.
I suspect that Exchange is barfing on the encoding, but I can't be sure
until I look at the samples you've uploaded. I don't have time to do so
today, but will look at them tomorrow morning.
--
Matthew Weier O'Phinney
PHP Developer | matthew-C1q0ot2/***@public.gmane.org
Zend - The PHP Company | http://www.zend.com/
David Brännlund
2007-12-17 15:06:33 UTC
Permalink
Post by Matthew Weier O'Phinney
I suspect that Exchange is barfing on the encoding, but I can't be sure
until I look at the samples you've uploaded. I don't have time to do so
today, but will look at them tomorrow morning.
We had this problem with one customer running Exchange server v6.5. After
some research we noted that the lines in a base64 encoded block were 2
characters longer when sending an email with ZF than with i.e. Thunderbird.

We changed the value of LINELENGTH on line 41 in Zend/Mime.php to 72 instead
of 74. Since then our customer receives attachments alright.


David Brännlund
COMSOL AB, Sweden
--
View this message in context: http://www.nabble.com/Zend_Mail-and-Microsoft-Exchange-Servers-tp14180559s16154p14372427.html
Sent from the Zend MFS mailing list archive at Nabble.com.
Florian Eibeck
2007-12-18 07:10:49 UTC
Permalink
We had a simmilar problem when sending HTML emails with embedded images with
Zend_Mail. Our customer uses Exchange (don't know the version) and Outlook
2003. The image attachments where always corrupted when viewed with Outlook
and Exchange, while other mailclients did not have a problem. Changing the
line length to 72 characters as described by David solved the problem and the
emails are now shown correct. This does not occur while using Outlook without
Exchange.

Greetings,
Florian Eibeck
Post by David Brännlund
Post by Matthew Weier O'Phinney
I suspect that Exchange is barfing on the encoding, but I can't be sure
until I look at the samples you've uploaded. I don't have time to do so
today, but will look at them tomorrow morning.
We had this problem with one customer running Exchange server v6.5. After
some research we noted that the lines in a base64 encoded block were 2
characters longer when sending an email with ZF than with i.e. Thunderbird.
We changed the value of LINELENGTH on line 41 in Zend/Mime.php to 72
instead of 74. Since then our customer receives attachments alright.
David Brännlund
COMSOL AB, Sweden
Justin Hendrickson
2007-12-18 15:07:02 UTC
Permalink
I'll create a bug report in JIRA and see if we can't get something
done about this. Thanks for your feedback!
Post by Florian Eibeck
We had a simmilar problem when sending HTML emails with embedded images with
Zend_Mail. Our customer uses Exchange (don't know the version) and Outlook
2003. The image attachments where always corrupted when viewed with Outlook
and Exchange, while other mailclients did not have a problem. Changing the
line length to 72 characters as described by David solved the problem and the
emails are now shown correct. This does not occur while using Outlook without
Exchange.
Greetings,
Florian Eibeck
Post by David Brännlund
Post by Matthew Weier O'Phinney
I suspect that Exchange is barfing on the encoding, but I can't be sure
until I look at the samples you've uploaded. I don't have time to do so
today, but will look at them tomorrow morning.
We had this problem with one customer running Exchange server v6.5. After
some research we noted that the lines in a base64 encoded block were 2
characters longer when sending an email with ZF than with i.e. Thunderbird.
We changed the value of LINELENGTH on line 41 in Zend/Mime.php to 72
instead of 74. Since then our customer receives attachments alright.
David Brännlund
COMSOL AB, Sweden
Matt Paine
2007-12-06 23:03:05 UTC
Permalink
(order of headers changed for easy comparison)


pear_mail_mime:
--=_a29b4740d6f627b6831d2d9a3903f74a
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name="sample.pdf";
Content-Disposition: attachment; filename="sample.pdf";



evolution:
--=-KKqrbXSr5EDql1JMe13W
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name=sample.pdf
Content-Disposition: attachment; filename=sample.pdf




phpmailer:
--b1_1c6f1fe5e97bc4a83a3a945f6ec79d7c
Content-Transfer-Encoding: base64
Content-Type: application/octet-stream; name="sample.pdf"
Content-Disposition: attachment; filename="sample.pdf"




zf-trunk:
--=_b100ee7e682ef3e0e9ecaeb8b26978ee
Content-Transfer-Encoding: base64
Content-Type: application/pdf
Content-Disposition: attachment; filename="sample.pdf"





------------------------------
I just glanced over the RFC and it mentions the Content-Type header
doesn't require the name parameter, but that seems to be the only
difference in the header for the ZendFramework message.

However......


The last few lines of the encoded messages are........


------------8<----------- evolution:
MSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgMTczIC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI0OTdG
REU3MjI0NUE1PiA8MDA4MzhDQzVCQjZERDJBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3RhcnR4
cmVmCjQ3NTI2MAolJUVPRgo=


--=-KKqrbXSr5EDql1JMe13W--
-----------------------------------------------------------------------------------


------------------8<---------- pear_mail_mime:
MDAgbiAKMzMgMSAKMDAwMDQ3NTE2MCAwMDAwMCBuIAp0cmFpbGVyCjw8L1NpemUgMzQgL0luZm8g
MSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgMTczIC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI0OTdG
REU3MjI0NUE1PiA8MDA4MzhDQzVCQjZERDJBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3RhcnR4
cmVmCjQ3NTI2MAolJUVPRgo=
--=_a29b4740d6f627b6831d2d9a3903f74a--
----------------------------------------------------------------------------------



--------------------8<------------ php_mailer
MSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgMTczIC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI0OTdG
REU3MjI0NUE1PiA8MDA4MzhDQzVCQjZERDJBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3RhcnR4
cmVmCjQ3NTI2MAolJUVPRgo=


--b1_1c6f1fe5e97bc4a83a3a945f6ec79d7c--
--------------------------------------------------------------------------


(all equal so far)


------------------------8<--------------- zf-trunk
MjAyIDAwMDAwIG4gCjAwMDA0NzI0MDggMDAwMDAgbiAKMzMgMSAKMDAwMDQ3NTE2MCAwMDAwMC
BuIAp0cmFpbGVyCjw8L1NpemUgMzQgL0luZm8gMSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgMTcz
IC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI0OTdGREU3MjI0NUE1PiA8MDA4MzhDQzVCQjZERD
JBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3RhcnR4cmVmCjQ3NTI2MAolJUVPRgo=
--=_b100ee7e682ef3e0e9ecaeb8b26978ee--
-----------------------------------------------------------------




So there might be an issue with the base64 encoding with the ZF code ?
Perhaps its acceptable in most circumstances and M$ is simply being
strict about what it accepts?

Just a guess :)



Matt
Marco Kaiser
2007-12-07 12:19:17 UTC
Permalink
Hi,

$att = $mail->createAttachment(file_get_contents('example.pdf'));
$att->type = 'application/pdf';
$att->disposition = Zend_Mime::DISPOSITION_ATTACHMENT;
$att->encoding = Zend_Mime::ENCODING_BASE64;
$att->filename = 'example.pdf';
$mail->send();

I tested it with this lines of code and my example.pdf was deliverd without
any problem.
Not reproducable here (Exchange 2007 and SBS 2003)
I saw in the headers that there some filters in. Maybe they have problems
with the mail?


X-Sieve: CMU Sieve 2.2
X-Virus-Scanned: ClamAV 0.91.2/5014/Wed Dec 5 14:24:38 2007 on
zulu.sierrabravo.net
X-Virus-Status: Clean
X-Evolution-Source: pop://jhendric%40sierra-bravo.com-***@public.gmane.org/

-- Marco
Post by Cameron Laird
-----Original Message-----
Sent: Friday, December 07, 2007 12:03 AM
Subject: Re: [fw-formats] Zend_Mail and Microsoft Exchange Servers
(order of headers changed for easy comparison)
--=_a29b4740d6f627b6831d2d9a3903f74a
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name="sample.pdf";
Content-Disposition: attachment; filename="sample.pdf";
--=-KKqrbXSr5EDql1JMe13W
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name=sample.pdf
Content-Disposition: attachment; filename=sample.pdf
--b1_1c6f1fe5e97bc4a83a3a945f6ec79d7c
Content-Transfer-Encoding: base64
Content-Type: application/octet-stream; name="sample.pdf"
Content-Disposition: attachment; filename="sample.pdf"
--=_b100ee7e682ef3e0e9ecaeb8b26978ee
Content-Transfer-Encoding: base64
Content-Type: application/pdf
Content-Disposition: attachment; filename="sample.pdf"
------------------------------
I just glanced over the RFC and it mentions the Content-Type header
doesn't require the name parameter, but that seems to be the only
difference in the header for the ZendFramework message.
However......
The last few lines of the encoded messages are........
MSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgMTczIC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI
0OTdG
REU3MjI0NUE1PiA8MDA4MzhDQzVCQjZERDJBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3R
hcnR4
cmVmCjQ3NTI2MAolJUVPRgo=
--=-KKqrbXSr5EDql1JMe13W--
-----------------------------------------------------------------------
------------
MDAgbiAKMzMgMSAKMDAwMDQ3NTE2MCAwMDAwMCBuIAp0cmFpbGVyCjw8L1NpemUgMzQgL0l
uZm8g
MSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgMTczIC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI
0OTdG
REU3MjI0NUE1PiA8MDA4MzhDQzVCQjZERDJBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3R
hcnR4
cmVmCjQ3NTI2MAolJUVPRgo=
--=_a29b4740d6f627b6831d2d9a3903f74a--
-----------------------------------------------------------------------
-----------
--------------------8<------------ php_mailer
MSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgMTczIC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI
0OTdG
REU3MjI0NUE1PiA8MDA4MzhDQzVCQjZERDJBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3R
hcnR4
cmVmCjQ3NTI2MAolJUVPRgo=
--b1_1c6f1fe5e97bc4a83a3a945f6ec79d7c--
-----------------------------------------------------------------------
---
(all equal so far)
------------------------8<--------------- zf-trunk
MjAyIDAwMDAwIG4gCjAwMDA0NzI0MDggMDAwMDAgbiAKMzMgMSAKMDAwMDQ3NTE2MCAwMDA
wMC
BuIAp0cmFpbGVyCjw8L1NpemUgMzQgL0luZm8gMSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgM
Tcz
IC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI0OTdGREU3MjI0NUE1PiA8MDA4MzhDQzVCQjZ
ERD
JBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3RhcnR4cmVmCjQ3NTI2MAolJUVPRgo=
--=_b100ee7e682ef3e0e9ecaeb8b26978ee--
-----------------------------------------------------------------
So there might be an issue with the base64 encoding with the ZF code ?
Perhaps its acceptable in most circumstances and M$ is simply being
strict about what it accepts?
Just a guess :)
Matt
Justin Hendrickson
2007-12-07 15:44:18 UTC
Permalink
Post by Marco Kaiser
$att = $mail->createAttachment(file_get_contents('example.pdf'));
$att->type = 'application/pdf';
$att->disposition = Zend_Mime::DISPOSITION_ATTACHMENT;
$att->encoding = Zend_Mime::ENCODING_BASE64;
$att->filename = 'example.pdf';
$mail->send();
Looks basically the same as my tests. I'm not sure what version of
Exchange the users have, though.

Obviously, if we can't reproduce the problem, it's going to be next to
impossible to fix it. The only things I can think of are asking the
PEAR::Mail_mime / PHPMailer authors if they recall any Exchange
work-arounds, contacting the MS Exchange Team (they have a blog here:
http://msexchangeteam.com/) or finding/creating a VMWare images with
different versions of Exchange and using that to do testing.
Post by Marco Kaiser
Hi,
I tested it with this lines of code and my example.pdf was deliverd without
any problem.
Not reproducable here (Exchange 2007 and SBS 2003)
I saw in the headers that there some filters in. Maybe they have problems
with the mail?
X-Sieve: CMU Sieve 2.2
X-Virus-Scanned: ClamAV 0.91.2/5014/Wed Dec 5 14:24:38 2007 on
zulu.sierrabravo.net
X-Virus-Status: Clean
-- Marco
Post by Cameron Laird
-----Original Message-----
Sent: Friday, December 07, 2007 12:03 AM
Subject: Re: [fw-formats] Zend_Mail and Microsoft Exchange Servers
(order of headers changed for easy comparison)
--=_a29b4740d6f627b6831d2d9a3903f74a
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name="sample.pdf";
Content-Disposition: attachment; filename="sample.pdf";
--=-KKqrbXSr5EDql1JMe13W
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name=sample.pdf
Content-Disposition: attachment; filename=sample.pdf
--b1_1c6f1fe5e97bc4a83a3a945f6ec79d7c
Content-Transfer-Encoding: base64
Content-Type: application/octet-stream; name="sample.pdf"
Content-Disposition: attachment; filename="sample.pdf"
--=_b100ee7e682ef3e0e9ecaeb8b26978ee
Content-Transfer-Encoding: base64
Content-Type: application/pdf
Content-Disposition: attachment; filename="sample.pdf"
------------------------------
I just glanced over the RFC and it mentions the Content-Type header
doesn't require the name parameter, but that seems to be the only
difference in the header for the ZendFramework message.
However......
The last few lines of the encoded messages are........
MSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgMTczIC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI
0OTdG
REU3MjI0NUE1PiA8MDA4MzhDQzVCQjZERDJBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3R
hcnR4
cmVmCjQ3NTI2MAolJUVPRgo=
--=-KKqrbXSr5EDql1JMe13W--
-----------------------------------------------------------------------
------------
MDAgbiAKMzMgMSAKMDAwMDQ3NTE2MCAwMDAwMCBuIAp0cmFpbGVyCjw8L1NpemUgMzQgL0l
uZm8g
MSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgMTczIC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI
0OTdG
REU3MjI0NUE1PiA8MDA4MzhDQzVCQjZERDJBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3R
hcnR4
cmVmCjQ3NTI2MAolJUVPRgo=
--=_a29b4740d6f627b6831d2d9a3903f74a--
-----------------------------------------------------------------------
-----------
--------------------8<------------ php_mailer
MSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgMTczIC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI
0OTdG
REU3MjI0NUE1PiA8MDA4MzhDQzVCQjZERDJBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3R
hcnR4
cmVmCjQ3NTI2MAolJUVPRgo=
--b1_1c6f1fe5e97bc4a83a3a945f6ec79d7c--
-----------------------------------------------------------------------
---
(all equal so far)
------------------------8<--------------- zf-trunk
MjAyIDAwMDAwIG4gCjAwMDA0NzI0MDggMDAwMDAgbiAKMzMgMSAKMDAwMDQ3NTE2MCAwMDA
wMC
BuIAp0cmFpbGVyCjw8L1NpemUgMzQgL0luZm8gMSAwIFIgL1Jvb3QgNCAwIFIgL1ByZXYgM
Tcz
IC9JRCBbPDAwODM4Q0M1QkI2REQyQUYzMTI0OTdGREU3MjI0NUE1PiA8MDA4MzhDQzVCQjZ
ERD
JBRjMxMjQ5N0ZERTcyMjQ1QTU+IF0gPj4Kc3RhcnR4cmVmCjQ3NTI2MAolJUVPRgo=
--=_b100ee7e682ef3e0e9ecaeb8b26978ee--
-----------------------------------------------------------------
So there might be an issue with the base64 encoding with the ZF code ?
Perhaps its acceptable in most circumstances and M$ is simply being
strict about what it accepts?
Just a guess :)
Matt
Loading...