You are here

function mailhandler_cron in Mailhandler 5

Same name and namespace in other branches
  1. 6 mailhandler.module \mailhandler_cron()
  2. 7 mailhandler.module \mailhandler_cron()

Implementation of hook_cron(). Process msgs from all enabled mailboxes.

File

./mailhandler.module, line 616

Code

function mailhandler_cron() {

  // store the original cron user
  mailhandler_switch_user();
  $result = db_query('SELECT * FROM {mailhandler} WHERE enabled = 1 ORDER BY mail');
  while ($mailbox = db_fetch_array($result)) {
    mailhandler_retrieve($mailbox);
  }

  // revert to the original cron user
  mailhandler_switch_user();
}