I'd like to figure out how to handle an MMS message consisting of a series of images and captions. This is basically a series of inline attachments: jpeg, text, jpeg, text, jpeg, text, jpeg, text.

Right now, all the text attachments after the first are simply discarded. The first caption appears as the node body.

What I would like to do is something like, pre-process the message and set any text attachment that follows a jpeg attachment as the description for its preceeding jpeg. Then process the message with mailsave_to_imagefield to save all the images and their descriptions.

Is there interest in mailsave having this functionality built-in or should I just build a custom module to do what I need?

CommentFileSizeAuthor
#1 mailsave-mimepart.patch955 bytesmfb

Comments

mfb’s picture

Status: Active » Needs review
StatusFileSize
new955 bytes

I ended up writing a small custom module with a hook_mailsave() implementation to handle this. But I did make a small patch on mailsave module, which allows my hook_mailsave() to merge data from the text parts in $node->mimeparts into the right place in the $node object.