HEX
Server: LiteSpeed
System: Linux d8 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: wbwebdes (3015)
PHP: 8.1.31
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/wbwebdes/domains/mailing.wb-cloud.nl/private_html/admin/actions/domainbounces.php
<?php
verifyCsrfGetToken();

if (!empty($_SESSION['LoadDelay'])) {
    sleep($_SESSION['LoadDelay']);
}
$status = '';

if (isset($_GET['domain'])) {
    //Replace everything except alphanumerical chars and period.
    $domain = preg_replace('@[^0-9a-z\.]+@i', ' ',  $_GET['domain']);
}
if (isset($_GET['bounces'])) {
    //make sure that bounces is integer.
    $bounces = (int) $_GET['bounces'];
}

$ls = new WebblerListing(s('Domain statistics'));
$ls->setElementHeading('Domain');

$sent = Sql_Query(sprintf("SELECT
  COUNT(*)
FROM
  (
  SELECT
    COUNT(email)
  FROM
    %s AS u
  INNER JOIN
    %s AS m ON u.id = m.userid
  WHERE
STATUS
  = 'sent' AND email LIKE '%%$domain'
GROUP BY
  email
) t", $GLOBALS['tables']['user'],
    $GLOBALS['tables']['usermessage'], 'sent'));

while ($row = Sql_Fetch_Row($sent)) {
    $sent = $row[0];
}

$viewed = Sql_Query(sprintf("SELECT
  COUNT(*)
FROM
  (
  SELECT
    COUNT(email)
  FROM
    %s AS u
  INNER JOIN
    %s AS m ON u.id = m.userid
  WHERE
STATUS
  IS NOT NULL AND email LIKE '%%$domain'
GROUP BY
  email
) t", $GLOBALS['tables']['user'],
    $GLOBALS['tables']['usermessage']));

while ($row = Sql_Fetch_Row($viewed)) {
    $viewed = $row[0];
}

$bounceRate=  sprintf('%0.2f', $bounces / $sent * 100)."%";
$viewRate=  sprintf('%0.2f', $viewed / $sent * 100)."%";

$ls->addElement($domain);
$ls->addColumn(
    $domain,
    s('Total bounced emails'),
    number_format($bounces));
$ls->addColumn(
    $domain,
    s('Total sent emails'),
    number_format($sent));
$ls->addColumn(
    $domain,
    s('Bounce rate'),
    $bounceRate);
$ls->addColumn(
    $domain,
    s('View rate').Help("viewrate"),
    $viewRate);
$status .= $ls->display();