The question is quite simple, just because the current invoke operation is not working, and I'm wondering if the reason why there are no any issues about this is because this hook has never been implemented in a contrib module.

This is the current code part invoking this hook:


// TODO: add arguments
function mailhandler_node_process_message($header, $origbody, $mailbox, $mimeparts) {
  mailhandler_switch_user();
  // we must process before authenticating because the password may be in Commands
  $node = mailhandler_node_prepare_message($header, $origbody, $mailbox);

  // Authenticate the message
  if (!$node = mailhandler_mailhandler_authenticate('execute', $mailbox['authentication'], array($node, $header, $origbody, $mailbox))) {
    watchdog('mailhandler', 'Message failed authentication', array(), WATCHDOG_ERROR);
    return FALSE;
  }

  // Put $mimeparts on the node
  $node->mimeparts = $mimeparts;

  // we need to change the current user
  // this has to be done here to allow modules
  // to create users
  mailhandler_switch_user($node->uid);

  // modules may override node elements before submitting. they do so by returning the node.
  foreach (module_list() as $name) {
    if (module_hook($name, 'mailhandler')) {
      $function = $name .'_mailhandler';
      if (!($node = $function($node, $result, $i, $header, $mailbox))) {

And I stop here.. where do $result and $i come from? i'm sure they were lost during the refactoring done in #679796: Refactor mailhandler_retrieve_message to break out node-specific processing. My bet is that currently there are no implementation of this hook.. if so, perhaps it is time to change this a little bit.

Comments

ilo’s picture

mm, appart from listhandler that does implement it..

cor3huis’s picture

$ grep -Ri "_mailhandler" *

Gave in modules I've downloaded:

  • Listhandler (crucial module for me)
    http://drupal.org/project/listhandler
  • media_mover (important)
    http://drupal.org/project/media_mover
  • mailcomment (I dont use it)
    http://drupal.org/project/mailcomment
  • There are possibly some others...

    ilo’s picture

    Thanks so muc, cor3huis, I'll will try to contact them to see if the found any issue regarding this hook. Aparently arguments are only reliable when fired though cron import.

    danepowell’s picture

    Component: Code » Mailhandler
    Status: Active » Closed (won't fix)

    Sorry, 6.x-1.x is no longer a supported release. Please try upgrading to 6.x-2.x and reopen if still an issue.