How to "unhook" a hook from a module? I want to use the email_auto_login module. However it implements a hook_mail_alter which I don't want.

/**
 * Implements hook_mail_alter().
 */
function email_auto_login_mail_alter(&amp;$message) {
  $user = user_load_by_mail($message['to']);

  // Don't add tokens for admin, anonymous or blocked.
  if (!isset($user-&gt;uid) || $user-&gt;uid == 1 || $user-&gt;status == 0) {
    return;
  }

  $token = _email_auto_login_generate_token($user);

  foreach ($message['body'] as &amp;$body) {
    $body = _email_auto_login_add_token($body, $token);
  }
}


Is there a way to remove the hook without modifying the above code? I'm running Drupal7.
You should be able to do it with hook_module_implements_alter(&amp;$implementations, $hook) in your module. Simply test $hook and if it is the hook you don't want implemented, unset($implementations['email_auto_login']).