Okay, I was not sure where to put this, so please excuse me if this is in the wrong place.

Here is the problem. I am using Listhandler, Mailhandler, forums and postgresql. When people mail to the mailing list, comments and new forum topics get posted. When I add a comment from the web interface the comment get's sent to the correct mailing list. When I post a new forum topic vai the web interface, the comment get's posted but no mail is sent. It just silently fails.

Here is the function that I *think* that sends the forum topic to the mailing list. If my understanding is correct, a node is inserted, the node_invoke_nodeapi function is called, all 'listening' modules with hook_nodeapi respond, including this listhandler one.

function listhandler_nodeapi(&$node, $op, $arg = 0) {
	
  switch ($op) {
    case 'update': // what to do with updates?
    break;
    case 'insert': // mail new forum topics to mailing list.
		
      if ($node->type == 'forum') {
        if($node->sentbylisthandler) { // avoid running an infinite loop.
          // save ids in listhandler table.
          db_query("INSERT INTO {listhandler} (msgid, nid, cid, pid, uid, mid, tid) VALUES ('%s','%s','%s','%s','%s','%s','%s')", $node->message_id, $node->nid, 0, 0, $node->uid, $node->mid, $node->tid);
          // call watchdog
          watchdog('listhandler', "Forum '". $node->title ."' inserted.");
        }
        else {
	

	print('Entering nodeapi case: insert first else'); 
          $node->subject = $node->title;
          $node->comment = $node->body;
          listhandler_send_mail(object2array($node));
        }
    }
      break; 


   }
}  

I think the problem appears in the second if statement. In this block it does not actually sends mail but rather just inserts something into listhandler table and then inserts a message into watchdog saying the message has been sent ... is this the way it is suppose to work?

Has anyone else managed to get mailhandler and listhandler working correctly on postgres?

Is my understanding of the code incomplete?

Thank you for any help in advance

--Trevor