Example #1
0
// Is debug enabled?
if ($SETTINGS->imap_debug == 'yes') {
    if (!is_dir(PATH . 'logs') || !is_writeable(PATH . 'logs')) {
        die('Imap debug enabled in settings, but "logs" folder either doesn`t exist or isn`t writeable. Please update.');
    }
}
// Load download class for mime types..
include PATH . 'control/classes/class.download.php';
$DL = new msDownload();
// Load mailer params..
include PATH . 'control/mail-data.php';
// Read mailbox and run..
$MSIMAP = new imapRoutine($IMDT);
$MSIMAP->settings = $SETTINGS;
$MSIMAP->datetime = $MSDT;
$mailbox = $MSIMAP->connectToMailBox();
// Load spam b8 filter if enabled..
if ($IMDT->im_spam == 'yes') {
    include PATH . 'control/lib/b8/call_b8.php';
    if (isset($b8_err)) {
        $MSIMAP->log('B8 spam filter fatal error: ' . $b8_err);
    } else {
        if (class_exists('b8')) {
            $MSIMAP->log('B8 spam filter successfully loaded');
            define('B8_LOADED', 1);
        }
    }
}
// Log..
$MSIMAP->log('Imap account found, preparing to connect to mailbox..');
if ($mailbox) {