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.");