Mollom alters all emails if any mollom_response info was generated in the request. This makes password recovery, new registration, etc. emails to include the "Report as inappropriate: ..." footer, which is quite misleading.

/**
 * This function adds a 'report as inappropriate' link to the e-mails that are sent
 * by the contact module.
 */ 
function mollom_mail_alter($key, $to, $subject, &$body, $from, $headers) {
  $response = $GLOBALS['mollom_response'];
  if (isset($response) && isset($response['session_id'])) {
    $body .= "\n\n". t('Report as inappropriate: @link', array('@link' => url('mollom/contact/'. $response['session_id'], NULL, NULL, TRUE)));
  }
}

The comment says, this is about to affect only contact emails, so mollom should filter $key to the contact emails as far as I see. Or if more emails are to be affected (eg. those sent by webform module), we need some way to control the mail keys to look at.

CommentFileSizeAuthor
#2 mollom-key.patch793 bytestoemaz

Comments

toemaz’s picture

Version: 5.x-1.5 » 5.x-1.6

I'd like to report the same inconvenient behavior of the mollom module: it adds Report as inappropriate: http://www.mydomain.com/mollom/contact/xxxx to all outgoing registration emails of my website. This is indeed quite confusing and misleading for the user.

toemaz’s picture

Status: Active » Needs review
StatusFileSize
new793 bytes

I saw that the Drupal 6 version of the mollom module does check whether it is contact mail or not

if ($message['id'] == 'contact_page_mail' && isset($GLOBALS['mollom_response']) && isset($GLOBALS['mollom_response']['session_id'])) {

so I went ahead and made a patch for the Drupal 5 release. Find it attached. All in all, a very minor tweak.

toemaz’s picture

Status: Needs review » Reviewed & tested by the community

Patch running in production for about 2 weeks now. No problems so far.

dries’s picture

Status: Reviewed & tested by the community » Needs work

I'm pretty sure this would break the mails for the per-user contact forms.

toemaz’s picture

Indeed it does break it. Perhaps this issue should be moved to 6.x-1.x-dev since I suspect it broken in the 6 release as well. A backport to 5 would be the best strategy.

dave reid’s picture

Status: Needs work » Closed (duplicate)