Return $node if no parameters are sent
| Project: | Mail Comment |
| Version: | 6.x-1.0-beta4 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Ian Ward |
| Status: | closed |
Jump to:
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
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
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
Thanks!
#4
Automatically closed -- issue fixed for 2 weeks with no activity.
#5
Switch to mailcomment project. Mail2web is now known as "mailcomment" due to a trademark issue with the name mail2web.