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

This commit is contained in:
johnnyq
2026-11-16 19:36:00 -05:00
parent 6eb6102dc0
commit 4faa0d91ca
8 changed files with 128 additions and 13 deletions

View File

@@ -829,10 +829,11 @@ function addToMailQueue($data) {
if (empty($attachment['path']) || empty($attachment['name'])) {
continue;
}
// A picture in the message goes in inline, where its cid: points (emailInlineImages())
$attachment_manifest[] = [
'path' => strval($attachment['path']),
'name' => strval($attachment['name'])
];
] + (!empty($attachment['cid']) ? ['cid' => preg_replace('/[^A-Za-z0-9@._-]/', '', (string) $attachment['cid'])] : []);
}
if ($attachment_manifest) {
$attachments = mysqli_escape_string($mysqli, json_encode($attachment_manifest));