This is maybe user error, but the documentation on the 7.x branch is still kind of sparse and I'm having trouble figuring it out on my own.

Whenever I try to create a node with an image from an email attachment, I get the following errors:

TYPE: ctools
MESSAGE: Invalid plugin module/type combination requested: module mailhandler and type filters
SEVERITY: error

TYPE: file
MESSAGE: The data could not be saved because the destination /tmp/image.jpg is invalid. This may be caused by improper use of file_save_data() or a missing stream wrapper.
SEVERITY: notice

- Text portion of email gets mapped to the node body just fine
- I have "attachments" mapped to an image field in the feed mapper. Same errors if I switch to a file field.
- I'm not having any other issues with the temporary directory and moving it to the site folder or to sites/default/files makes no difference.
- Using ctools version 7.x-1.0-alpha4

I would appreciate any assistance.

Comments

danepowell’s picture

Yeah, I'm still working on the documentation piecemeal-style, in response to individual issues. But, that doesn't sound like it's the case here.

MESSAGE: Invalid plugin module/type combination requested: module mailhandler and type filters

This is especially weird, and probably the first place I'd look for clues. I'll have to investigate (or feel free to do some investigating of your own- I may not get around to this for a while).

kmarkley’s picture

Component: Documentation » Code
Category: support » bug

Thanks for your response. I'm not a coder but I do have some (ancient) programming experience and I'd like to help out if I am able.

a) I see the same errors on a fresh install with nothing enabled beyond what is needed to test.

b) I have pretty much exhausted configuration options (field type, field number, node type, mapping, preferred mime type, temp directory locations, etc.) and now very much doubt this is a configuration/documentation issue.

c) I am actually getting the ctools error (Invalid plugin module/type combination requested: module mailhandler and type filters) on every node import, including those without attachments. That said, the import appears to be working fine without attachments.

d) I notice that there is a small difference between the D6 and D7 versions of file_save_data() but the code in MailhandlerParser.inc that calls it is the same in the 6.x-2.0-alpha6 and 7.x-2.0-alpha6 versions.

I'm not knowledgable enough to know if this is just improved documentation or if the D6 version expects a simple path for $dest while the D7 version expects a full URI. I apologize if I'm pointing out a distinction without a difference.

a & b above make me think this is a bug. Steps to reproduce are basically fresh drupal 7 install enabling mailhandler, image, and all their cascading dependencies. Leave default temporary directory. Create a mailhandler mailbox, map attachments to a file or image field in the default feed importer. Send an email with attached image to the mailbox and visit import/mailhandler_nodes.

I'll keep poking around as time allows.

danepowell’s picture

It may be that the errors are unrelated- certainly on the surface they appear to be. But, (without having investigated this at all- just going by appearances) I think the first one points to a more fundamental problem, since it is more pervasive as you observed, and this may be the root cause for both issues.

Like I said- I'll get around to it when I can- specifically, after #1147414: Restructure command / parser plugins, which I don't expect will wrap up anytime too soon, since I'm waiting on feedback from other parties (Feeds maintainers)

rhia05’s picture

i have the same problem also..i configured mailhandler 2.x and its working well, my problem is when i import attachments to my site it gives an error>>> "The data could not be saved, because the destination is invalid"

danepowell’s picture

Status: Active » Postponed (maintainer needs more info)

Can you please verify that this is still an issue with beta1? There have been some big changes to the parser/commands system...

kmarkley’s picture

I am now having difficulty getting mailhandler to work at all. On a fresh install I get this error when I try to import anything (with or without an attachment):

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /batch?id=34&op=do StatusText: OK ResponseText: Fatal error: Call to a member function getMappingSources() on a non-object in […]/sites/all/modules/mailhandler/plugins/MailhandlerParser.inc on line 129

Also get the same error (more or less) when I attempt to edit mapping on the feed importer (/admin/structure/feeds/edit/mailhandler_nodes/mapping):

Fatal error: Call to a member function getMappingSources() on a non-object in […]/sites/all/modules/mailhandler/plugins/MailhandlerParser.inc on line 129

drupal 7.2
mailhandler 7.x-2.0-beta1
feeds 7.x-2.x-dev (7.x-2.0-alpha3 causes WSOD on access import page)
ctools 7.x-1.0-beta1

danepowell’s picture

Version: 7.x-2.0-alpha6 » 7.x-2.0-beta1
Status: Postponed (maintainer needs more info) » Active

That's not good... sounds like a plugin is not being loaded properly

lalit774’s picture

#6 is resolved by changing following code

Path mailhandler/plugins/MailhandlerParser.inc on line 129

 $sources = array_merge($sources, $plugin->getMappingSources());

Replace with

 $sources = array_merge($sources, parent::getMappingSources());
TimelessDomain’s picture

#8 fixed the problem mentioned in #6, but i cannot get the files to add correctly

Invalid plugin module/type combination requested: module mailhandler and type filters
the error still appears. using latest dev. releases of ctools and feeds.

my settings

under "Mailhandler IMAP stream parser"
- "COMMAND PLUGINS" -> "Files processor" is selected (as well as Default commands processor & Headers processor)
- added "attachments" under "AVAILABLE COMMANDS"

mapped "attachments" to "Image"

Where did adding "attachments" under "AVAILABLE COMMANDS" come from? I could not find such info in the documentation.

note: the email "subject" source is not mapping to node:title either right now (but other Available & Default Commands are working properly)

rout’s picture

#8 worked for me.

But I also have the same issue as #9, using mailhandler but subject is not mapping to title...

danepowell’s picture

Status: Active » Closed (duplicate)