Return $node if no parameters are sent

lutegrass - March 15, 2009 - 07:36
Project:Mail Comment
Version:6.x-1.0-beta4
Component:Code
Category:feature request
Priority:normal
Assigned:Ian Ward
Status:closed
Description

In the case where a site wants to receive email and have comment replies all share one address, something like support@... , it would be good to let mail2web hand the node object back to mailhandler if no parameters are set. Mailhandler will stop working if the email address for new inbound emails is the same mail2web uses for comment replies.

at line 234 in mail2web.module, I propose you add return $node after the error:

  elseif ($header->toaddress == $mbox_name && !$params) {
    mail2web_error(MAIL2WEB_ERROR_PARAMS, $node, $header);
    return $node;
  }

This should be harmless since it's a message that doesn't belong to mail2web anyway -- it should be handed back to mailhandler which has plenty of options to handle or throw it away. Otherwise, you have to setup two email addresses, one for mailhandler submissions and another for web2mail replies -- not ideal.

Thanks for your consideration.

#1

lutegrass - March 19, 2009 - 02:51

It should actually be ...

  elseif ($header->toaddress == $mbox_name && !$params) {
    return $node;
  }

without the error because it's really not an error, it's just that it might be an initial submission email, not a reply to something. It might be a message that should be ignored by mail2web and handled by mailhander.

#2

Ian Ward - April 3, 2009 - 21:43
Assigned to:Anonymous» Ian Ward
Status:active» fixed

Committed to 6.x and 5.x branches. Thanks for catching this lutegrass. I actually made a setting for this. The problem w/ this is if the params are stripped from the header, and the user actually mangles the params in the message body (since they're in the editable text) we have a boundary case where the message could get mistakenly passed through to mailhandler. I added a setting called "passthru" in order for a choice the be given to the site administrator.

#3

lutegrass - April 4, 2009 - 02:26

Thanks!

#4

System Message - April 18, 2009 - 02:30
Status:fixed» closed

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

#5

Ian Ward - November 16, 2009 - 18:05
Project:Mail to Web» Mail Comment
Version:6.x-1.0-beta2» 6.x-1.0-beta4

Switch to mailcomment project. Mail2web is now known as "mailcomment" due to a trademark issue with the name mail2web.

 
 

Drupal is a registered trademark of Dries Buytaert.