Development mode for a test copy, set on Admin Backup and kept in config.php: every email goes to the test inbox with its recipient in the subject or is cancelled without one, texts wait, the ticket mailbox is not read, AI Triage, Stripe, autopay, RMM device actions, log forwarding, managed check-ins and telemetry are off, and a DEVELOPMENT badge shows in the top bar; 26.11.9 changelog entries

This commit is contained in:
johnnyq
2026-11-17 19:22:10 -05:00
parent 22f9315c81
commit 71dab1cca7
20 changed files with 291 additions and 4 deletions

View File

@@ -92,6 +92,14 @@ if (demoModeOn()) {
cronJobStop("Demo - no email is sent");
}
// Development mode sends every email to the test inbox (sendQueueEmail()) - with none set in
// config.php, what was queued is cancelled the same way (functions/dev_mode.php)
if (devModeOn() && devModeMailTo() === '') {
mysqli_query($mysqli, "UPDATE email_queue SET email_status = " . MAIL_QUEUE_CANCELLED . ", email_failed_at = NOW()"
. mailQueueErrorSql("Not sent - development mode, with no test inbox in config.php") . " WHERE email_status IN (0, 2)");
cronJobStop("Development mode with no test inbox - no email is sent");
}
// Nothing to send through isn't an error either - an App Logs entry every minute buried the real ones
if (empty($config_smtp_provider)) {
cronJobStop("No mail server is set up to send through - see Admin > Settings > Mail");
@@ -213,6 +221,13 @@ function sendQueueEmail(
string $oauth_access_token,
string $oauth_access_token_expires_at
) {
// Development mode: to the test inbox instead, its real recipient at the front of the subject (functions/dev_mode.php)
if (devModeOn()) {
$subject = '[DEV to ' . $to_email . '] ' . $subject;
$to_email = devModeMailTo();
$to_name = '';
}
// Google and Microsoft each expose exactly one XOAUTH2 SMTP endpoint, so the
// stored host/port/encryption are overridden rather than used as a fallback -
// the same thing cron/ticket_email_parser.php already does on the IMAP side.