Hi all,
I'm using the mail2web module provided with 5.x-1.0-beta3. The system is sending emails (typically a post from an OG forum) just fine to recipients, but when the user replies and the cron picks up the task, I get the following log entry:
"Received an email with no parameters from Some User : Re: Comment for Forum topic: A kiss is not a contract"
The key part of course is the email with no parameters. So I traced this back to a new method that was added in the last release:
function mail2web_mailhandler($node, $result, $i, $header, $mailbox) {
// The In-reply-to header is cleaned and passed in $node->threading
if ($node->threading && ($params = mail2web_check_messageparams($node->threading))) {
// Now check user id , just go ahead if they match and it is a valid user
if ($node->uid && $node->uid == $params['uid']) {
// Set comment parameters
$node->type = 'comment';
$node->nid = $params['nid'];
$node->pid = $params['cid'];
//drupal_set_message(print_r($params, TRUE));
return $node;
} else {
watchdog('mail2web', t('Received an e-mail without a valid user id'), WATCHDOG_WARNING);
}
}
// If no valid parameters, it just swallows the message, no further action will be done.
// @ TODO Add some setting so other modules are allowed to handle these messages
}
Which apparently has called the mail2web_parse_messageparams($messageid) function and gotten no params.
I'm not a coder, and am still pretty new to Drupal. I'm not sure what I did that is causing this, or if perhaps it is bug. We're long overdue on getting this email functionality working for a nonprofit. I would greatly appreciate help!
Saganesque
Comments
Comment #1
Saganesque commentedSorry, I mentioned the wrong calling function. It is this one:
function mail2web_check_messageparams($messageid) {
if ($params = mail2web_parse_messageparams($messageid)) {
$signature = $params['signature'];
unset ($params['signature']);
// Check digital signature and expiration time if set
if ($signature && $signature == mail2web_signature($params)) {
// Check signature has not expired
if (($expire = variable_get('mail2web_expiration', 0)) && $params['time'] + $expire < time()) {
watchdog('mail2web', t('Received an email with a expired signature.'));
} else {
return $params;
}
} else {
watchdog('mail2web', t('Received an email without signed parameters.'), WATCHDOG_WARNING);
}
} else {
watchdog('mail2web', t('Received an email with no parameters'), WATCHDOG_WARNING);
}
}
Comment #2
Saganesque commentedThis problem was was a consequence of not having the same server string in Mail2Web for an old message and a new reply to that message.