Ejemplo n.º 1
0
            }
            if ($dbug) {
                echo "email -> {$email} :: DB -> {$db->GetDBName()}\n";
            }
            $reason = get_reason($filename);
            // determine if this is a quota bounce or not, and set db column to update in mle.bounced table
            if (stristr($contents, 'full') or stristr($contents, 'quota')) {
                $bounced_col = 'mailboxfull';
                $reason = $reason ? "Mailbox is Over Quota!\n" . $reason : 'Mailbox is Over Quota.';
            } else {
                $bounced_col = 'count';
                $reason = $reason ? "Mailbox is Bouncing!\n" . $reason : 'Mailbox is Bouncing!';
            }
            $db->SelectDB('mle');
            // insert into mle.bounced table
            $reason = $db->EscapeString($reason);
            // get other bounced column
            $col_other = $bounced_col == 'count' ? 'mailboxfull' : 'count';
            $sql = "INSERT INTO bounced (bademail, {$bounced_col}, reason, datelogged) VALUES ('{$email}', '1', '{$reason}', NOW())\n              ON DUPLICATE KEY UPDATE {$bounced_col}={$bounced_col}+1, {$col_other}=0, reason='{$reason}', datelogged=NOW()";
            if (!$dbug) {
                $db->Query($sql);
                @unlink($filename);
                echo "procroot: {$bounced_col} -> {$email} :: DELETED -> {$filename}\n";
            } else {
                echo "{$filename}\n{$sql}\n\n";
            }
            break;
        }
    }
}
echo "procroot: QUIT\n";