Download & Extend

Iphone images not consistently saved

Project:Mailsave
Version:6.x-1.3
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

I'm trying to figure out why iphone images are not consistently working with mail to image. Unfortunately I don't have an iphone to test with.

Here's what I've noticed:

Using mac.com images are not detected. The email becomes a blog post.

One users images were working when he was in New Jersey, but not in Nevada.

If I receive the iphone emails with images on a gmail account and then forward to my server's account, the images are detected and converted to image nodes.

I would appreciate any suggestions.

Thanks

Comments

#1

Status:active» postponed (maintainer needs more info)

No idea what the issue is here, I also don't have an iPhone. If someone wants to e-mail me a message from iPhone to debug, contact me via my contact tab...

#2

I'm guessing it might be the mime type (Content-Type: ) in your mail header (check your email message -> view source). Some servers send images as octet-streams. Currently mailsave to imagefield only supports type /image, but you can update this check as follows (line 93 in mailsave_to_imagefield.module in this example) to include application/octet stream as follows:

    if ( (trim($cck_image_extensions) == '' || strpos($cck_image_extensions, _file_ext($file['filename'])) !== FALSE ) && ( strpos(strtolower($file['filemime']), 'image/') === 0 ) || (strpos(strtolower($file['filemime']), 'application/octet-stream') === 0 ))

Then again, you might run into a "Content-type: multipart/ mixed" image attachment as well, so maybe leave out the content-type check entirely:

      if ( (trim($cck_image_extensions) == '' || strpos($cck_image_extensions, _file_ext($file['filename'])) !== FALSE )) {

nobody click here