Mollom attaches "Report as Inappropriate" message to system generated email

takinola - February 6, 2009 - 20:30
Project:Mollom
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Dave Reid
Status:closed
Description

When a user registers on my site, Drupal automatically sends out a welcome message. Unfortunately, Mollom appends a message to the end of the email asking the recipient to "Report as inappropriate: htttp://mywebsite.com/mollom/contact".

Since this is a system generated email, Mollom should not request this action from the user. Is there a way to remove this line?

Thanks

Configuration:
Drupal 5.14
Mollom 5.x-1.7

#1

Dave Reid - March 25, 2009 - 21:12

This seems valid. Seems like we should check the the mail is actually generated by the contact.module instead of the system or user modules. I'll look into this.

#2

kriskd - May 7, 2009 - 16:13

An user on my site just reported this as well. I agree this should not be on the confirmation e-mail that go to the user that submitted the message. Can I safely remove this completely until a better solution is found?

#3

gapple - June 8, 2009 - 08:05

I encountered this issue with automated replies to site-wide contact form submissions in D6.

#4

Dave Reid - June 9, 2009 - 22:36
Version:5.x-1.7» 6.x-1.x-dev
Assigned to:Anonymous» Dave Reid

I frequently catch myself clicking the report to Mollom link in e-mails sent by comment_notify, which has no result because I need to report the actual comment itself. Comment notify e-mails do not by default even include the comment text. Maybe we should create a white-list of email IDs (from drupal_mail()) that are allowed to be scanned by Mollom and display the report link: 'page_mail' and 'user_mail'. Attached patch for 6.x-1.x for testing.

AttachmentSize
370369.patch 1.05 KB

#5

Dave Reid - June 9, 2009 - 22:40

#6

Dave Reid - June 9, 2009 - 23:13
Status:active» needs review

#7

Dries - June 10, 2009 - 07:03

I agree that this is a bug. However, the white-listing shouldn't be necessary. When a form is not protected with Mollom, we shouldn't call the Mollom service, and isset($GLOBALS['mollom_response']) should return FALSE. In other words: the current if-test should be sufficient. The question is: why is $GLOBALS['mollom_response'] set when a form is not protected with Mollom?

#8

Dries - June 10, 2009 - 07:04
Status:needs review» needs work

#9

xushi - June 23, 2009 - 13:49

Registering.

I'm getting the same problem too with the site-wide contact form. Anonymous users when submitting forms get the automated reply, with that line in it, which they shouldn't IMO.

Please let me know how i can help if you need any info.

#10

xushi - June 23, 2009 - 18:18

I find the easiest way to delete it is to edit mollom.module, and comment out

$report_link = t('Report as inappropriate: @link', array('@link' => url('mollom/contact/'. $GLOBALS['mollom_response']['session_id'], array('absolute' => TRUE))));

in the function mollom_mail_alter(&$message) { function around line 275, and replace it with

$report_link = '';

So the end will look like this,

<?php

function mollom_mail_alter(&$message) {
  if (isset(
$GLOBALS['mollom_response']) && isset($GLOBALS['mollom_response']['session_id'])) {
    
//xushi - remove the inappropriate line from emails.
    
$report_link = '';
   
//$report_link = t('Report as inappropriate: @link', array('@link' => url('mollom/contact/'. $GLOBALS['mollom_response']['session_id'], array('absolute' => TRUE))));

    // The _mail_alter hook seems to accept both arrays as strings so we
    // need to handle both. TODO: it seems like something we want to clean
    // up upstream.
   
if (is_array($message['body'])) {
     
$message['body'][] = $report_link;
    }
    else {
     
$message['body'] .= "\n\n". $report_link;
    }
  }
}
?>

#11

gapple - June 23, 2009 - 19:26

@xushi, that essentially disables the function and removes the link from all outgoing mail; commenting out the function or adding a return statement as the first line of the function would have the same effect as your change.

The link should still appear on messages from the contact module which could be missed spam that needs to be reported.

#12

xushi - June 24, 2009 - 10:32

@gapple, well said.. I didn't spend enough time looking into it.. I guess we'll have to wait until the bug is squashed :)

#13

Dave Reid - July 3, 2009 - 23:13

@Dries: The problem is: in the case of comment_notify, the mollom session variable is there because Mollom was protecting the comment form. Because comment_notify sends the e-mail in the same request as submitting the comment, when the e-mail is sent, Mollom thinks that the e-mail sent by comment_notify was Mollom-protected, but that was not the case.

#14

Dave Reid - July 27, 2009 - 17:01

Marked #428586: Report as abuse link in registration confirmation as a duplicate of this issue.

#15

Dave Reid - July 30, 2009 - 22:20
Status:needs work» fixed

So we should really make this a white-list of e-mails sent using the contact forms, which would only be the message IDs: 'page_mail', 'page_copy', 'user_mail', 'user_copy'. I committed the basic white-list to mollom_mail_alter().

#16

Dave Reid - July 30, 2009 - 23:43

Backported to Drupal 5 as well.

#17

Wim Leers - July 31, 2009 - 11:37

Awesome :)

#18

System Message - August 14, 2009 - 11:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#19

AppleBag - August 19, 2009 - 23:16

Where do I get this fix for 5x?

 
 

Drupal is a registered trademark of Dries Buytaert.