Programmatically enable Mollom protection for a form
I didn't find a better way, so I did inserts directly into the DB.

In mymodule.install:

function mymodule_update_70001() {
  # CAPTCHA on registration form
  db_insert('mollom_form')
    -&gt;fields(array(
      'form_id' =&gt; 'user_register_form',
      'mode' =&gt; 1,
      'checks' =&gt; 'a:0:{}',
      'discard' =&gt; 1,
      'enabled_fields' =&gt; 'a:0:{}',
      'strictness' =&gt; 'normal',
      'module' =&gt; 'user',
    ))
    -&gt;execute();


  # CAPTCHA on password reset form
  db_insert('mollom_form')
    -&gt;fields(array(
      'form_id' =&gt; 'user_pass',
      'mode' =&gt; 1,
      'checks' =&gt; 'a:0:{}',
      'discard' =&gt; 1,
      'enabled_fields' =&gt; 'a:0:{}',
      'strictness' =&gt; 'normal',
      'module' =&gt; 'user',
    ))
    -&gt;execute();

  # Text analysis of comments
  $response = db_insert('mollom_form')
    -&gt;fields(array(
      'form_id' =&gt; 'comment_node_mynode_form',
      'mode' =&gt; 2,
      'checks' =&gt; 'a:2:{i:0;s:4:"spam";i:1;s:9:"profanity";}',
      'discard' =&gt; 0,
      'enabled_fields' =&gt; 'a:2:{i:0;s:7:"subject";i:1;s:27:"comment_body][und][0][value";}',
      'strictness' =&gt; 'normal',
      'module' =&gt; 'comment',
    ))
    -&gt;execute();

  # Text analysis of submission
  $response = db_insert('mollom_form')
    -&gt;fields(array(
      'form_id' =&gt; 'mynode_node_form',
      'mode' =&gt; 2,
      'checks' =&gt; 'a:2:{i:0;s:4:"spam";i:1;s:9:"profanity";}',
      'discard' =&gt; 0,
      'enabled_fields' =&gt; 'a:4:{i:0;s:5:"title";i:1;s:19:"body][und][0][value";i:2;s:32:"field_projectpage][und][0][value";i:3;s:33:"field_downloadpage][und][0][value";}',
      'strictness' =&gt; 'normal',
      'module' =&gt; 'node',
    ))
    -&gt;execute();
}