Control whatever to read attached RFC822 mail content

Reading into the attached RFC822 message as osTicket does by default may cause troubles when the first mail section does not contain a content type text/html. OsTicket will in this case use the body from the attached mail as content as it searches recursive for text/html content first. Email clients will normally show this messages as attachments

We have several cases where emails are handled wrongly especially spam reports.

This change will add an option in the admin panel settings->email tab to control whatever the inline message content should be read or treated as an attachment by osTicket
My point is that you are removing all non-ascii characters from the subject line and then, if the length is below two characters, using a random name. That logic won't work for languages other than English — especially with respect to your comment that the "[subject] contains important information to the end user in order to get a fast overview of the ticket". The logic should provide the subject to end users of all languages.