johnnyq
a31471eff3
Mail: Microsoft 365 sends email and reads the support mailbox through Microsoft Graph when the app on the OAuth tab has Mail.Send or Mail.ReadWrite, so the mailbox needs no SMTP AUTH, and SMTP or IMAP stay in use for whatever it lacks; new functions/mail_graph.php with mailGraphToken caching the Graph token and its scopes and keeping the rotated refresh token, mailGraphSend sending the finished MIME or a draft with uploaded attachments past 3 MB, and functions/mail_graph_mailbox.php standing in for ImapEngine in the email parser; the OAuth tab says which way email goes, Test IMAP and Test OAuth Token Refresh cover Graph, the Exchange token renewals now name their scope, database 3.9.2 adds three settings columns, 26.11.9 changelog entries
2026-11-17 23:49:02 -05:00
johnnyq
71dab1cca7
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
2026-11-17 19:22:10 -05:00
johnnyq
707fdaedd4
Robustness: lists take page 1 at least and an open end date, portal sessions go to the portal from the main address, custom page forms no longer load a missing post/ai.php, cron jobs that stop with an error code show as Failed with the parser saying what the mail server answered, the mail queue keeps a refreshed OAuth token for the rest of the run, the update check keeps the newest 100 commits and counts them all, restore_cli works on a database with no settings yet, the API reads a non-JSON body as no fields and clamps limit and offset, API client delete removes the client's uploads, contact anonymizing redacts stored values longest first, the asset transfer log names the asset, the client duplicate check escapes wildcards, and Access Modules drops its dead buttons and sorts only on its own columns; 26.11.9 changelog entries
2026-11-17 16:15:23 -05:00
johnnyq
6e313f0c7d
Ticket Schedule Cancelled emails send on Microsoft 365: sendQueueEmail puts a calendar file in its own text/calendar part only for a meeting with an organizer and attendees and attaches the rest as invite.ics, so a ticket's cancellation goes attached like its booking instead of as a meeting Exchange refuses; a failed send keeps the SMTP server's reply in email_error; 26.11.9 changelog entries
2026-11-16 22:31:59 -05:00
johnnyq
4faa0d91ca
Pasted pictures go with ticket emails as pictures attached inline: emailInlineImages takes each data image out of an email's HTML to uploads/tmp/mail_images, stored once by its hash, and points it at a cid that the mail queue attaches with addEmbeddedImage, so mail programs that show no data images show them and the queue keeps each picture once rather than in every email; Admin Mail Queue shows them back in the message and counts only files as attachments, a meeting request with pictures goes as an attached invite, and nightly removes pictures no queued email uses; 26.11.9 changelog entries
2026-11-16 19:36:00 -05:00
johnnyq
c2eb55c8dc
Mail queue keeps what a sent email said: only an email with a link or code that opens something - a shared login and its code, a portal or agent invite, a password link, a contract to sign or a task to approve - is cleared once sent, and a day after it was queued if it failed or was cancelled; emailQueue gains a sensitive option set by those senders, cron marks sent email with mailQueueSentSql, nightly runs mailQueueClearSensitive, and a cleared email can't be retried; database 3.7.1 adds email_queue.email_sensitive and marks email waiting at the update; 26.11.9 changelog entries
2026-11-16 18:48:57 -05:00
johnnyq
9f8676fe48
Quieter App Logs from cron: the email parser no longer logs a run summary every minute mail comes in or is left in the inbox, and echoes its counts and time instead; with no IMAP or SMTP provider set up the email parser and mail queue stop with a reason Maintenance Cron shows instead of an App Logs entry every minute; the mail queue, ticket SLA monitor, domain refresher and certificate refresher stop without an App Logs error while cron is switched off, as the email parser already did; 26.11.9 changelog entries
2026-11-16 17:38:51 -05:00
johnnyq
980f394ee2
Send mail again on installs first set up with Microsoft 365 or Google OAuth on 26.11: cast the SMTP host to a string at both sendQueueEmail call sites, since it is NULL until a host is saved and the typed argument threw a TypeError that ended the mail queue run before anything was sent; catch any Throwable around each send so one failing email is marked failed and the rest still go out, where only PHPMailer's own Exception was caught and an Error left the email as Sending; add the changelog entries. Fix reported by toto707 on the forum
2026-11-10 16:25:07 -05:00
johnnyq
2a36534583
Add demo mode for a public demo like demo.itflow.org - $config_demo_mode = true; in config.php puts one-click sign-in buttons for Admin, Technician, Accountant and a client portal contact on the sign-in page and a demo notice on every page, and the new Demo Reset cron job rebuilds the demo nightly at 2:00 AM from db.sql with all starter content, the demo clients and the demo accounts, empties uploads except the logo and signs everyone out, keeping the company details, timezone and cron schedules; visitors can try everything except users and roles, their own sign-in details, mail, payment, AI and texting settings, API keys, backups, updates, cron, log forwarding, company, module and portal settings, custom links, starter content and share links, Debug is closed, guest links open only for someone signed in, queued email is cancelled with the reason, no sign-in alert emails are sent, certificate checks reach only public addresses on port 443, and the domain and certificate refreshers are left out; new functions/demo.php and cron/demo_reset.php, no database change, changelog, CONTRIBUTING and README updated
2026-11-06 17:46:40 -05:00
johnnyq
0618ecfdd0
Mail queue stage 2: keep why each email failed or who cancelled it in the new email_queue.email_error column (database 3.3.7), written by the worker on every failure path and cleared on send or retry, show and search it on the list, include it in failure alerts and alert when the last retry gives up, and rebuild the email view with its status, reason, recipients, tries, times, attachments, calendar file, Retry now, Cancel and Delete, showing the message in a sandboxed frame
2026-10-20 11:34:57 -04:00
johnnyq
7e2971b610
Mail queue stage 1: rebuild the mail queue list with Waiting, Sending, Retrying, Failed, Sent and Cancelled tabs and counts, a status line per email, a banner when sending is off, cron is off or not running, the job is disabled or mail is waiting too long, and Retry now, Cancel and Delete per email and in bulk applied only where possible, add a Cancelled status, record the failure time for bad addresses, share the retry limits between the page and the worker, and fix the theme favicon reset failing on its audit entry
2026-10-20 11:34:23 -04:00
johnnyq
3ec52974db
Calendar modernization: calendar page rebuilt to load only the dates on screen with show or hide toggles for each calendar and for built-in sources (scheduled tickets, project start and due dates, service reviews, recurring tickets, renewals, invoices due), a filter for one agent, quick looks on click, drag to reschedule tickets and events that do not repeat, and a To schedule panel for dragging open unscheduled tickets onto the calendar; events get a shared add/edit form with repeats every N days/weeks/months/years with an optional end date and single skipped occurrences, a client site, location or meeting link, agents, client contacts and guest emails as attendees, iCalendar invitations with updates and cancellations sent to invited attendees, an event quick look with map and join links, .ics download and resend; each agent gets a personal subscription link for their schedule (their own or the whole team, busy only option, respects role and client access, stops when the account is disabled) with setup help for Google, Outlook, Apple, Nextcloud and Thunderbird; shared calendar feeds and invites now publish timed events with TZID and VTIMEZONE so repeating events keep their time across DST, with INTERVAL, UNTIL and EXDATE support; managing calendars is limited to admins; ticket schedule logic moved into functions/ticket.php and shared with the calendar, the schedule dialog shows the assigned agent's day, and ticket visit calendar files are rebuilt without zapcal as one-hour published events; mail queue sends invitations and cancellations as a text/calendar part and other calendar files as invite.ics; dashboard schedule shows only events the agent is on or added, client overview Coming up and client sidebar count use upcoming events, sites and contacts get New event shortcuts, demo data uses repeating events and attendees; database update 2.8.8 adds event repeat interval, until, skip, sequence and created by, attendee user and invited at, user_calendar_feeds, and widens email_queue.email_cal_str to text
2026-10-15 19:17:17 -04:00
johnnyq
076f45abb0
Remove Stale SMTP IMAP host if switching Standard SMTP.IMAP to OAUTH
2026-08-09 23:59:54 -04:00
johnnyq
b3744e9ed5
More sweeps to replace select * with actual returned column names dramatically reduces php memory usage and speeds up processing dramatically especially in the crons since they run all the time
2026-08-06 13:10:23 -04:00
johnnyq
b8c9d5b4cf
Query Optimization: Select only needed columns instead of SELECT * on looped queries
2026-08-06 12:59:43 -04:00
johnnyq
0631c45040
Fix Cron Schedule and new directory includes created inside cron for the cron lock
2026-07-30 17:06:07 -04:00
johnnyq
38e8edea19
Cron runs all jobs from a single dispatcher cron.php which should now be run every minute and all other cron jobs eliminated from cron
2026-07-30 13:48:39 -04:00
johnnyq
2395a3ee16
Phase 2 of ticket attachements by agents
2026-07-29 18:10:34 -04:00
johnnyq
c5ff3e2a3f
Normalize line endings to LF; add .gitattributes and .editorconfig
2026-07-28 17:45:52 -04:00
johnnyq
4c65b8c561
Clear mail bodies after successful delivery
2026-07-28 00:18:07 -04:00
johnnyq
a844d7b428
Adds a shared flock guard used by all five cron entry points, keyed per
...
script and per install. Replaces the mail queue's own lock file, which
was not atomic and could be deleted out from under a long run. Bounds
the SMTP conversation so an unresponsive server cannot hold the lock.
Recovers rows left at Sending by a run that died, which nothing
previously picked up.
2026-07-27 17:35:39 -04:00
johnnyq
686fca99e1
Fix Possible duplicate emails in a race condition in mail queue
2026-07-27 16:59:10 -04:00
johnnyq
b57ddc0e5c
Replace Function sanitizeInput() with just escapeSql() and update all instances throughout
2026-07-14 17:17:50 -04:00
johnnyq
8da3a107fb
Rename plugins to libs and update all file references
2026-07-10 13:24:20 -04:00
cs2000
fc33312e79
SonarCube Suggestion
...
Rename multiple functions to conform to project naming rules (^[a-z][a-zA-Z0-9]*$). This is a non-functional refactor for style/CI compliance and consistency.
2026-02-05 10:15:52 +00:00
cs2000
10d1a902d9
Changes for M365 oAuth now using latest dev code
...
My bad, my changes were made previously using my installed version and not the latest changes in the dev branch, i have pulled the dev branch and merged my changes with the latest codebase.
2026-02-05 09:37:22 +00:00
cs2000
f3f9d0dd71
Changes for M365 oAuth
...
- Added OAuth token lifecycle helpers (expiry check, refresh, persistence).
- Updated SMTP XOAUTH2 send path to automatically refresh expired/missing access tokens for Microsoft/Google providers before sending queued mail.
2026-02-04 13:25:32 +00:00
johnnyq
0a30300bde
replace all instances of mysqli_fetch_array with mysqli_fetch_assoc for better performance and memory usage
2026-01-14 17:30:23 -05:00
wrongecho
7c83ba15b9
Mail queue - minor comment syntax error
2025-12-03 15:43:55 +00:00
wrongecho
10bfbed4bb
Mail queue - introduce a --no-mx-validation flag to bypass recipient domain MX validation
2025-12-03 15:30:26 +00:00
johnnyq
185ea7d6ac
Fix 'Email from at' On tickets that come from emails, was cuasing dup html head body tags causing htmlPurifier to strip it in ticket viewing, so we removed html body and head tags also remove orginal reply on reply ticket emails this removed ##- Please type your reply above this line -## and anything after it. Also removed the custom CSS that was embedded for all email sent out from ITFlow
2025-11-22 17:40:44 -05:00
wrongecho
891f71006b
Mail queue - Recipient domain MX validation before sending
2025-11-06 16:58:18 +00:00
johnnyq
76c9933baf
Update imap and smtp providers to allow empty string if empty do not execute mail queue
2025-10-02 14:28:43 -04:00
johnnyq
c769bbc405
Created new Mail Queuer to take advantage of OAUTH2 for M365 and Google Workspaces not enabled by default
2025-09-16 15:43:54 -04:00