Mailsave is exactly what i was looking for. Thank you for that!
I use mailhandler to gather e-mail to forums for a small community site. Mailsave gives my users the option to add attachments but if there is a jpg mailsave will always convert the node type. The converted node ends up on the frontpage instead of the specified forum (its no longer of the type "forum topic").
I understand that this is the only way mailsave can ever work (with image conversion), but is it possible to make it a bit more configurable? A setting which contenttypes or taxonomy to include or exclude in image conversion would do the trick for me. That way mailsave could be used for any type of content, offer e-mail in options to them all while keeping special types like forum items from falling out of context. For these special types images should remain attachments (without images conversion).
I could disable the image module as a work-around but that would criplle other parts of my site.

A complete rewrite to a method that can even add images in the rich-text body of (forum) items would also do the trick.... i'll leave that up to you ;-) (just kidding)

Comments

Stuart Greenfield’s picture

Mailsave should only convert nodes to image if the user has the permission 'convert to image node'. If they don't have that, but do have 'save attachments', then a jpeg should just be attached.

Is mailsave saving even without users having that permission? I know that as it stands mailsave will auto-convert the administrator's posts irrespective of settings as the administrator automatically has all privileges.

Choosing which content types to apply conversion to is an interesting idea - I am currently working on a complete re-vamp of mailsave to make it more modular and extensible, so that could be added to the development plans.

Can you post again if mailsave is changing the node type to image even with the conversion permission not set as that means that there is a bug!

vector70’s picture

It's not a bug. All users have the permission to add and convert images. Removing that persmission would reduce other functionallity.
If you make content type selection part if you development plan that would be great!
It's not that urgent since I'm trying to add functionallity that wasn't there in the fist place, so adding it to an old codestream is a bit mutch to ask.
I'll be happy to test it on my testserver if your re-vamped takes shape.

Thanks!!

vector70’s picture

I looked a little further into the image module and the way mailsave is using it. My knowlegde of drupal programming is a bit limited so correct me if i'm wrong....

If image attach is enabled i can use image module to add a image to any type of content. The content type of the node i'm writing will stay as is (e.g. Story) and image module creates an extra node for the image. The whole process is invisible to the user.

If mailsave would work in a similar fashion then administrators would be able to add mailhandler tasks for many types of content. If mailhandlers is set to create a image node it still still just create an image node converting the mime image into it. If mailhandler is told to create a story, forum topic or any other type then it would ultimately create that specific nodetype, create a seperate image node and attach it (instead of overriding the mailhandler setting).

I do believe this would be much better than my previous suggestion of selecting contenttypes. This method increases flexibility and acts just like image module does on its own.

Hope you will consider this for your next version.

Stuart Greenfield’s picture

Assigned: Unassigned » Stuart Greenfield

Ah - I see what you mean. I will add the idea of limiting the node conversion depending on original content type to the development plan. I'd see this working at an overall level, so you could choose to have,say, 'story' items converted, but 'blog' items not. Would that work for your site?

I have to admit that I've not used image_attach to attach images to posts, but I will also look in to seeing if this can be integrated. The new version of mailsave is modular, so you will be able to activate the basic mailsave module, and then extend it by choosing a range of "plug ins" (at least that is the idea!). At the moment this is at a beta stage but it is working for image and audio content. It may therefore be possible to write another plug-in that interfaces with image_attach.

You also said

A complete rewrite to a method that can even add images in the rich-text body of (forum) items would also do the trick

You might be able to achieve what you want here by using the inline module. This uses a simple macro format to put images in posts. I've not used this much, but I have tested mailsave (running in "save attachment" mode) with inline and it worked ok.

I am currently doing some active work upgrading flash node so won't be committing much on mailsave at the moment, but will hopefully return to it again shortly.

Please post again if you need any more help in the meantime!

Stuart Greenfield’s picture

Status: Active » Reviewed & tested by the community

I had a bit of free time today (at last!) so I have had a go at implementing a new module 'mailsave_to_image_attach' that does the above.

If you enable the image_attach module, and then enable this new module too, then incoming messages that contain an image file will cause a new image node to be created, and the image node will be attached. This means that if your original content type was, say, forum, then it will remain as forum but it will have a linked image node.

I have given this some limited testing and it appears to be working. I've committed it to HEAD, so it will be available in the HEAD download when the package is next generated. Please post any follow up on this thread as it now needs testing.

Stuart Greenfield’s picture

Status: Reviewed & tested by the community » Fixed

Mailsave v3 was released this evening, and includes mailsave_to_image_attach as part of the package.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.