Example #1
0
 // determine column and DB based on first letter in userID
 if ($_col == 'C' or $_col == 'L') {
     $user_col = 'userID';
     $db->SelectDB('mle');
 } else {
     $user_col = 'affid';
     $db->SelectDB('fap');
 }
 // extract email from mle or fap if exists, if not exist abort, move on to next file
 if ($db->Query("SELECT {$col} FROM users WHERE {$user_col} = '{$userID}' AND {$col} != '' LIMIT 1")) {
     list($email) = $db->FetchRow();
 } else {
     break;
 }
 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';