// Abort if autopurge is not active or disabled by admin
if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive()) || (getConfig('ap_del_mails') != 'Y')) {
// Abort here
// Abort if autopurge is not active or disabled by admin
if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive()) || (getConfig('ap_del_mails') != 'Y')) {
// Abort here
if (!SQL_HASZERONUMS($result_mails)) {
// Okay, check for their sender's
while ($content = SQL_FETCHARRAY($result_mails)) {
if (!SQL_HASZERONUMS($result_mails)) {
// Okay, check for their sender's
while ($content = SQL_FETCHARRAY($result_mails)) {
if (!SQL_HASZERONUMS($result_mails)) {
// Okay, check for their sender's
while ($content = SQL_FETCHARRAY($result_mails)) {
if (!SQL_HASZERONUMS($result_mails)) {
// Okay, check for their sender's
while ($content = SQL_FETCHARRAY($result_mails)) {
if (($deletedStats > 0) && (getConfig('ap_dm_notify') == 'Y')) {
// Send out email to admin
sendAdminNotification('{--ADMIN_AUTOPURGE_DELETE_MAILS_SUBJECT--}', 'admin_autopurge_del_mails', $deletedStats);
if (($deletedStats > 0) && (getConfig('ap_dm_notify') == 'Y')) {
// Send out email to admin
sendAdminNotification('{--ADMIN_AUTOPURGE_DELETE_MAILS_SUBJECT--}', 'admin_autopurge_del_mails', $deletedStats);