function autoimapdie($result) { global $logprefix; if ($result === false) { $errors = imap_errors(); $warnings = imap_warnings(); $messages = array_merge($errors, $warnings); foreach ($messages as $key => $value) { $messages[$key] = htmlspecialchars_uni($value); } if (!empty($messages)) { $messages = htmlspecialchars("\"" . implode("\", \"", $messages) . "\""); log_cron_action("$logprefix Failed due to imap errors or warnings: $messages", $nextitem); } } }