Zend Framework

Quoted Printable Problems

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.1.5, 1.7.3
  • Fix Version/s: 0.9.2, 1.7.5
  • Component/s: Zend_Mime
  • Labels:
    None
  • Fix Version Priority:
    Must Have

Description

<originally posted to fwgeneral>

Problem 1:

First the rfc states lines have a 76 character (encoded form) hard limit in length. This limit while implemented isnt working quite right. Lines regularily reach 80 chars.

This is due to the tack on of the =20 after the split (see second line) the other lines I think are over by one character but I might just be counting wrong.

IE:

man",Times,serif; color: #666; margin-bottom: 5px; line-height: 1.5em; borde=
r-bottom: 1px solid #ccc; font-size: 20px; margin-top: 10px; }=0A=09=09h2 {=20=
font-size: 14px; color: #666; margin-bottom: 10px; line-height: 1.5em; borde=

Problem 2:

= line endings, aka soft breaks.

Im not sure why, and I dont see in the RFC any explanation but my email clients all have a problem with the following line ending scenario

An encoded entity, followed by a softbreak, immediately followed by another encoded identity

Eg

=09=09US<br />=0A=09=09=09=09=09Phone #: 1<br />=0A=09=09=09=09=09=09=09=09=
=09</p>=0A=09=09=09</td>=0A=09=09=09<td style=3D"width: 50%">=0A=09=09=09=09=

This will always result in an = sign being printed on the line below Phone #:1<br />. My intutition is that if the following line begins with an identity, the soft-break = should be omitted, though I cant find anything in the rfc to back this up.

Issue Links

Activity

Hide
Kevin McArthur added a comment -

Update.

Chanign the line ending from \r\n to \n by itself resolves this error in a functional way. The new resultant output however, appears RFC invalid.

A temporary fix is

Index: library/Zend/Mime.php
===================================================================
— library/Zend/Mime.php (revision 918)
+++ library/Zend/Mime.php (working copy)
@@ -39,7 +39,7 @@
const DISPOSITION_ATTACHMENT = 'attachment';
const DISPOSITION_INLINE = 'inline';
const LINELENGTH = 74;

  • const LINEEND = "\r\n";
    + const LINEEND = "\n";
    const MULTIPART_ALTERNATIVE = 'multipart/alternative';
    const MULTIPART_MIXED = 'multipart/mixed';
    const MULTIPART_RELATED = 'multipart/related';
Show
Kevin McArthur added a comment - Update. Chanign the line ending from \r\n to \n by itself resolves this error in a functional way. The new resultant output however, appears RFC invalid. A temporary fix is Index: library/Zend/Mime.php =================================================================== — library/Zend/Mime.php (revision 918) +++ library/Zend/Mime.php (working copy) @@ -39,7 +39,7 @@ const DISPOSITION_ATTACHMENT = 'attachment'; const DISPOSITION_INLINE = 'inline'; const LINELENGTH = 74;
  • const LINEEND = "\r\n"; + const LINEEND = "\n"; const MULTIPART_ALTERNATIVE = 'multipart/alternative'; const MULTIPART_MIXED = 'multipart/mixed'; const MULTIPART_RELATED = 'multipart/related';
Hide
Daniel Schregenberger added a comment -

I seem to have similar problems.

GMX mangles mails sent with Zend/Mail. It does convert the softbreaks to real line breaks. Also when using POP3.
I suspect their spamfilter but I don't know what to do about it. Having 8-bit encoding would probably fix this. I'm not sure about workarounds.

Show
Daniel Schregenberger added a comment - I seem to have similar problems. GMX mangles mails sent with Zend/Mail. It does convert the softbreaks to real line breaks. Also when using POP3. I suspect their spamfilter but I don't know what to do about it. Having 8-bit encoding would probably fix this. I'm not sure about workarounds.
Hide
Alexei Yuzhakov added a comment -

We use Zend Framework and especially Zend_Mail in our product SiteBuilder - http://www.swsoft.com/en/products/sitebuilder3/
We have responce about this bug from our customers. LINEEND = "\r\n" really doesn't work correct all the time (many reports about using this with qmail installations). But using LINEEND = "\n" solves this problem. We had tested with many intallations of sendmail, postfix and qmail MTAs and LINEEND = "\n" always worked correctly.
So I suggest to apply fix into SVN.

Show
Alexei Yuzhakov added a comment - We use Zend Framework and especially Zend_Mail in our product SiteBuilder - http://www.swsoft.com/en/products/sitebuilder3/ We have responce about this bug from our customers. LINEEND = "\r\n" really doesn't work correct all the time (many reports about using this with qmail installations). But using LINEEND = "\n" solves this problem. We had tested with many intallations of sendmail, postfix and qmail MTAs and LINEEND = "\n" always worked correctly. So I suggest to apply fix into SVN.
Hide
Bill Karwin added a comment -

Scheduling for release 0.7.0.

Show
Bill Karwin added a comment - Scheduling for release 0.7.0.
Hide
Eric Coleman added a comment -

It possible to get the spam cleared out of here

And maybe even get the scheduled release bumped up

Show
Eric Coleman added a comment - It possible to get the spam cleared out of here And maybe even get the scheduled release bumped up
Hide
Garth Gillespie added a comment -

I saw that this wasn't addressed in the 0.7.0 release.

I realize that \r\n is the RFC but something in how it is implemented in ZF does not make several MTA's happy.

Here are problem mail servers/clients you can use to test.

With \r\n in Zend/Mime.php send a multi-part html/text email using quoted-printable.

Use QPopper on the local machine to retrieve mail to any mail client (i.e. Outlook) - HTML is shown badly broken

Send to a gmail account - html will be broken.

Send to Exchange 5, Lotus Groupware (just about any version) - html broken.

gmail is probably the easiest test for this project to use.

Show
Garth Gillespie added a comment - I saw that this wasn't addressed in the 0.7.0 release. I realize that \r\n is the RFC but something in how it is implemented in ZF does not make several MTA's happy. Here are problem mail servers/clients you can use to test. With \r\n in Zend/Mime.php send a multi-part html/text email using quoted-printable. Use QPopper on the local machine to retrieve mail to any mail client (i.e. Outlook) - HTML is shown badly broken Send to a gmail account - html will be broken. Send to Exchange 5, Lotus Groupware (just about any version) - html broken. gmail is probably the easiest test for this project to use.
Hide
Garth Gillespie added a comment -

What is the deal with this getting continually pushed back. Do the developers disagree with the proposed fix?

Show
Garth Gillespie added a comment - What is the deal with this getting continually pushed back. Do the developers disagree with the proposed fix?
Hide
Garth Gillespie added a comment -

Matthew,

Can you give an update on this issue please?

Show
Garth Gillespie added a comment - Matthew, Can you give an update on this issue please?
Hide
Matthew Weier O'Phinney added a comment -

I've patched the Zend/Mime.php file in revision 4310. Please update from SVN and test. It still passes all unit tests, but I want to be sure that it resolves the problems reported by each of you.

Garth – the reason for the pushback has been a simple lack of time to address all my areas of responsibility in the framework. I apologize – it's indeed a trivial fix, but it's been entirely off my radar.

Show
Matthew Weier O'Phinney added a comment - I've patched the Zend/Mime.php file in revision 4310. Please update from SVN and test. It still passes all unit tests, but I want to be sure that it resolves the problems reported by each of you. Garth – the reason for the pushback has been a simple lack of time to address all my areas of responsibility in the framework. I apologize – it's indeed a trivial fix, but it's been entirely off my radar.
Hide
Garth Gillespie added a comment -

I checked the SVN history and see that all you changed was the LINEEND line - that is what I have always changed - so this change will work with the mailers I outlined above - including gmail.

Thanks!

Show
Garth Gillespie added a comment - I checked the SVN history and see that all you changed was the LINEEND line - that is what I have always changed - so this change will work with the mailers I outlined above - including gmail. Thanks!
Hide
Matthew Weier O'Phinney added a comment -

Resolving per Garth Gillespie

Show
Matthew Weier O'Phinney added a comment - Resolving per Garth Gillespie
Hide
Kevin McArthur added a comment -

Changing LINEEND does not resolve this bug. Its a tempfix at best. The larger issue here is RFC invalid quoted printable support.

Show
Kevin McArthur added a comment - Changing LINEEND does not resolve this bug. Its a tempfix at best. The larger issue here is RFC invalid quoted printable support.
Hide
Kevin McArthur added a comment -

Reopening as this issue is not resolved.

Show
Kevin McArthur added a comment - Reopening as this issue is not resolved.
Hide
Benjamin Eberlei added a comment -

Issue resolved by adding a new function Zend_Mime::encodeQuotedPrintableHeader which enforces RFC

Show
Benjamin Eberlei added a comment - Issue resolved by adding a new function Zend_Mime::encodeQuotedPrintableHeader which enforces RFC
Hide
Satoru Yoshida added a comment -

I copied to 1.7 branch at SVN r13886.

Show
Satoru Yoshida added a comment - I copied to 1.7 branch at SVN r13886.
Hide
Satoru Yoshida added a comment -

Sorry, not in 1.7.4. I think it will be released in next minor or major.

Show
Satoru Yoshida added a comment - Sorry, not in 1.7.4. I think it will be released in next minor or major.
Hide
Benjamin Eberlei added a comment -

This will be in 1.7.5

Show
Benjamin Eberlei added a comment - This will be in 1.7.5

People

Vote (6)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: