You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
[1.8.3] — 2026-11-15
Fixed
Campaign initialization on GLPI 11/12 — corrected the maximum-user-ID query to use GLPI's supported aggregate query-builder syntax. The previous expression was quoted as a literal column name (MAX(id)) and caused MySQL error 1054 before a campaign could start.
Changed
The From: address is always GLPI's notification sender (Config::getEmailSender(): the configured sender email, then the administrator email), for test sends and mass sends alike. Previously the administrator email was used, and a selected "Reply to" user became the From: address too: sending under a personal address through GLPI's SMTP account is rejected or flagged as spoofing by many mail servers (SPF/DMARC, sender/login mismatch). The selected user now only receives replies (Reply-To:).
The SMTP envelope sender uses the configured smtp_sender when valid. Symfony derives the SMTP MAIL FROM from the Sender header; otherwise it falls back to From.
A send with no valid sender is refused with an explicit message instead of leaving without a From: address.
A queue started before the upgrade and resumed after it falls back to GLPI's sender.
The entity ID is stored with new queues and used for sender resolution throughout every batch, even if the active entity changes in the browser session.
Added
fromEmail / fromName parameters on QueueService::initQueue() and MailService::sendMails(), plus MailService::resolveSender(), so that an integration (for example an API bridge) can pass the sender it resolved for an entity. An invalid address is ignored and GLPI's sender applies; control characters are stripped from display names.
Validation
Added real Symfony Mailer test coverage for MIME From, Reply-To, and Sender headers and the derived SMTP envelope sender.
CI now installs Symfony Mailer only in the runner's temporary test environment; no third-party runtime dependency is bundled with the plugin.
Verified PHP 8.2–8.6, GLPI 11 and GLPI 12 compatibility checks, PSR-4 mapping, translation catalogs, and the installation ZIP build.
Security
Rebuilt footer HTML from a strict element allowlist, discarding all supplied attributes except validated HTTP(S)/mailto links. Unquoted event handlers and other attributes can no longer survive sanitization.
Attachment validation follows GLPI's uploadable document-type rules, including regular-expression extension rules. GLPI's MIME field is optional; when a MIME is configured, the plugin verifies it against the actual file content and rejects mismatches instead of trusting the filename.
Inline images are restricted to validated raster formats; SVG and other active/XML image formats are rejected.
Queue reliability
Added database advisory locks to serialize per-campaign batch processing across PHP workers sharing the GLPI database.
GLPI database API compatibility — advisory locks now execute through the supported $DB->doQuery() method; the removed/unsupported $DB->query() call caused campaign sends to fail before the first recipient was processed. Lock names are restricted to safe characters, and acquisition/release failures are logged.
Added sequential batch validation and an in-flight marker to reject replayed or out-of-order batch requests. A request that terminates after marking a batch in-flight leaves the queue blocked rather than silently resending that batch.
Replaced offset-based recipient pagination with an ID cursor and a campaign-start upper ID bound, preventing row shifts when users are disabled or changed during a campaign and excluding users created after campaign initialization.
Empty recipient selections now return without persisting an orphan queue. Campaigns remain independently addressable, while each campaign batch is serialized by its own database advisory lock.
Additional regression validation
Ran attachment regression checks for PDF with an explicit MIME, extension-only document types with a blank MIME, regex-based extension rules, MIME/content mismatches, and unlisted extensions. The merged 1.8.3 release passed the repository CI package checks on PHP 8.2–8.6 and the post-merge security workflow. Live GLPI database and SMTP integration should still be verified in the target installation.
Acknowledgements
Thank to @FathiBenNasr for opening the original sender-identity PR and contributing the initial From/Reply-To separation. The contribution was retained and extended in this release.