-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Mail header - boundary issue (related to ZF2015-04) #7503
Comments
Please see #7501 |
I'm not sure it is really related. (Although special characters break my implementation as well, but since that was covered already, I didn't mention it.) If it is related, I'm probably not understanding the proposed solution of mime encoding all header values. My headers, before updating to 2.4.1:
Encoding the content-type header gives something like (if I'm doing it right)
And this doesn't work in a lot of mail clients |
Using the example in the last post of #7501 it was indeed fixed:
I do however still find it strange I receive the header like this in my mailbox (without any quoted-printable encoding), but I don't have time to investigate.
|
That's normal behavior; your mail server and/or mail client performs the decoding for you. |
I'm viewing the 'raw source' in Mail (on Mac). Headers like subject are still encoded:
So I'm guessing it must be the server :) |
@Qronicle I've tested your code and I din't see Content-type quoted encoded. Please attach a Gist with all variables defined. |
https://gist.github.com/Qronicle/dbd168d9cb9c84add6b1 It's the complete Mail class and a small send mail script at the bottom. The Mail class is mostly filler except for the send method at the end. |
I assume it should resolve my original problem? Because sadly it doesn't :) I've updated my gist to the bare minimum: https://gist.github.com/Qronicle/dbd168d9cb9c84add6b1 The HeaderValue::isValid method does not accept the LF character. |
@Qronicle I think I've found the problem. When we call |
@Qronicle The problem is one of your own making: You're using |
You are correct indeed. But I just noticed there is a boundary property on a Mime Part as well, and if I use that, it's still the same problem.
Zend\Mime\Mime::LINEEND also seems to be just "\n" Edit: This was probably the problem you already mentioned :) |
Can you provide a sample that includes how you're using it with |
To be sure I also updated https://gist.github.com/Qronicle/dbd168d9cb9c84add6b1 |
…ray() Per the gist provided by @Qronicle, I've created a unit test against `Zend\Mail\Message`, and a proposed fix. `Zend\Mime\Part::getHeadersAsArray()` accepts an optional argument, the line separator sequence. This defaults to `\n`, but for mail messages, should be `\r\n`. The proposed patch passes that argument when retrieving MIME headers to include in the mail message.
Alternate patch: #7514 |
…getHeadersAsArray() Per the gist provided by @Qronicle, I've created a unit test against `Zend\Mail\Message`, and a proposed fix. `Zend\Mime\Part::getHeadersAsArray()` accepts an optional argument, the line separator sequence. This defaults to `\n`, but for mail messages, should be `\r\n`. The proposed patch passes that argument when retrieving MIME headers to include in the mail message.
The ZF2015-04 security fix (2.4.1) has broken my Mail implementation. I'm creating a 'multipart/alternative' MIME part with a boundary setting. (I basically copied the Mail spec of ZF1, since ZF2's impementation had a lot of issues for me)
I'm not really sure on how to set the boundary with the new checks in place.
Relevant snippet:
Exception thrown on last line of that snippet:
The text was updated successfully, but these errors were encountered: