I am getting the following error in the PHP error log when attaching any image, via file uploader or copy/paste:
PHP Fatal error: Uncaught Laminas\Mime\Exception\InvalidArgumentException: Provided part 9di_44v5-2qr3az5imodnep2b6xjq2om@(email domain redcated) already defined. in C:\apache\htdocs(redacted)\include\laminas-mail\vendor\laminas\laminas-mime\src\Message.php:49
Stack trace:
#0 C:\apache\htdocs\include\class.mail.php(77): Laminas\Mime\Message->addPart()
#1 C:\apache\htdocs\include\class.mail.php(110): osTicket\Mail\Message->addMimePart()
#2 C:\apache\htdocs\include\class.mailer.php(525): osTicket\Mail\Message->addInlineImage()
#3 [internal function]: osTicket\Mail\Mailer->osTicket\Mail{closure}()
#4 C:\apache\htdocs\include\class.mailer.php(509): preg_replace_callback()
#5 C:\apache\htdocs\include\class.email.php(235): osTicket\Mail\Mailer->send()
#6 C:\apache\htdocs\include\class.ticket.php(3455): Email->send()
#7 C:\apache\htdocs\scp\tickets.php(218): Ticket->postReply()
#8 {main}
thrown in C:\apache\htdocs\include\laminas-mail\vendor\laminas\laminas-mime\src\Message.php on line 49
I looked at the article at https://forum.osticket.com/d/101446-images-broke-in-body-text/5 but that works for us - it's just any images attached fail.
Mail settings:
Incoming: OAuth2 configured and working token valid. Received images work fine via email, i. e. customer screenshots work great. Responding to those images also works great.
SMTP: Enabled, no auth required, email diagnostic sends emails OK, emails sent without agent-attached images work OK.
File size in Settings and System: Stored on filesystem in a folder that is working (folders being created), max size 8 mb, auth required to view images.
Temporary fix: I commented out lines 47-55 in include\lamnias-mail\vendor\laminas\laminas-mime\src\Message.php to remove the duplicate part check.
I confirmed that the images are sent successfully.