Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images wrongly attached to the mail #50

Closed
M-Falken opened this issue Apr 29, 2013 · 9 comments
Closed

Images wrongly attached to the mail #50

M-Falken opened this issue Apr 29, 2013 · 9 comments

Comments

@M-Falken
Copy link

Hi
I've noticed on the last commit, that now inline images base64 encoded are wrongly attached to my mails, as before they were embedded.

Result before the change (open and close tags omitted for the cid lines):

--b2_66908324beade643ef61833062a95135
Content-Type: image/jpeg; name="E_maging_Compute_4e1573014c224.jpg"
Content-Transfer-Encoding: base64
Content-ID: vendor_image
Content-Disposition: inline; filename="E_maging_Compute_4e1573014c224.jpg"

Result with the new commits:

--b2_4c18b756c600578cfb921d1e3123e7c0
Content-Type: image/jpeg; name="E_maging_Compute_4e1573014c224.jpg"
Content-Transfer-Encoding: base64
Content-ID: [email protected]
Content-Disposition: inline; filename=E_maging_Compute_4e1573014c224.jpg

The "cid:" call of the image is the same for both source mail.
But in the second case, the image is broken and just attached to the mail (wrongly)
Line 2493 in class.phpmailer.php could be the one.

I don't know if the lacks of quotes could have an influence on that. Not yet test that point.
Anyway it's an RFC recomend so...

Thanks for the work ;)

@Synchro
Copy link
Member

Synchro commented Apr 30, 2013

I've restored boundary quotes for #48, but unnecessary filename quotes do get flagged by msglint, and using your filename in Apple Mail does not result in a quoted name. Can you give it another try and see if the boundary quoting change fixes it?

@ReneRafael
Copy link

UNSUBSCRIBE
On Apr 29, 2013 5:11 PM, "Grégory Roussel" [email protected] wrote:

Hi
I've noticed on the last commit, that now inline images base64 encoded are
wrongly attached to my mails, as before they were embedded.

Result before the change:

--b2_66908324beade643ef61833062a95135
Content-Type: image/jpeg; name="E_maging_Compute_4e1573014c224.jpg"
Content-Transfer-Encoding: base64
Content-ID:
Content-Disposition: inline; filename="E_maging_Compute_4e1573014c224.jpg"

Result with the new commits:

--b2_4c18b756c600578cfb921d1e3123e7c0
Content-Type: image/jpeg; name="E_maging_Compute_4e1573014c224.jpg"
Content-Transfer-Encoding: base64
Content-ID:
Content-Disposition: inline; filename=E_maging_Compute_4e1573014c224.jpg

The "cid:" call of the image is the same for both source mail.
But in the second case, the image is broken and just attached to the mail
(wrongly)
Line 2493 in class.phpmailer.php could be the one.

I don't know if the lacks of quotes could have an influence on that. Not
yet test that point.
Anyway it's an RFC recomend so...

Thanks for the work ;)


Reply to this email directly or view it on GitHubhttps://github.com//issues/50
.

@Synchro
Copy link
Member

Synchro commented Apr 30, 2013

On 30 Apr 2013, at 13:40, Rene Rafael Vogt-Lowell [email protected] wrote:

UNSUBSCRIBE

That's not going to do anything - go and change your settings on GitHub.

@M-Falken
Copy link
Author

Hi Synchro,

I've tried at work today, but was not good too. Same issue.
But I do now some other tests to be sure, and will try to tweak a bit the code to see if this is the inline regex detection stuff that is the cause of this.

@M-Falken
Copy link
Author

ok
if I restore this line (1848 of the b5b2ae1):
$mime[] = sprintf("Content-ID: %[email protected]%s", $cid, $this->LE); //RFC2392 S 2
to what it was before:
$mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);

My image is ok into the mail with the full url in the source.
if not the cid: for the image is like this:
src="cid:vendor_image"

So isn't something wrong in the cid generation in the function MsgHTML?
Because it's always src="cid:vendor_image"
shouldn't it be src="cid:[email protected]"
?

@Synchro
Copy link
Member

Synchro commented May 1, 2013

I'd missed a place where it was setting the cid for the embedded image, so it was making a new cid instead of using the one already created (line 2493). That's fixed in HEAD now, please give it a try.

Synchro referenced this issue in Synchro/PHPMailer May 1, 2013
Fix double suffix on image cids, see #50
Remove unneeded test files, re-use example content for tests
Remove reference to phpmailer-lite
Ignore .idea folder
@Synchro
Copy link
Member

Synchro commented May 1, 2013

Spotted another error - it was also creating those matching cids in AttachAll, which could result in duplicate suffixes when combined with MsgHTML. I've now altered it so it only uses the suffixed cids in MsgHTML - everywhere else you're expected to do it yourself, which is as it used to be.
All that said, I'm seeing an odd problem where it shows a 'missing plugin' error in Apple Mail when there's an embedded png (as generated by the test suite), yet the markup looks ok. This seems independent of this cid generation change.

@M-Falken
Copy link
Author

M-Falken commented May 1, 2013

Ok Acknowledge.
This apart it's ok for me, my last tests return to me that the issue is fixed. (019499e included)

@Synchro
Copy link
Member

Synchro commented May 1, 2013

Thanks, closing.

@Synchro Synchro closed this as completed May 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants