You are here

function mailhandler_update_6205 in Mailhandler 6.2

Enables the new Mailhandler PHP IMAP module.

Enables mailhandler_php_imap and makes it the default retrieval library for existing Mailhandler mailboxes.

File

./mailhandler.install, line 335
Install, update and uninstall functions for the Mailhandler module.

Code

function mailhandler_update_6205() {
  $ret = array();
  module_enable(array(
    'mailhandler',
    'mailhandler_php_imap',
  ));
  $result = db_query('SELECT * FROM {mailhandler_mailbox}');
  while ($row = db_fetch_array($result)) {
    $row['settings'] = unserialize($row['settings']);
    $row['settings']['retrieve'] = 'MailhandlerPhpImapRetrieve';
    drupal_write_record('mailhandler_mailbox', $row, 'mid');
  }
  return $ret;
}