Sorry for so many posts. I have been investigating this further to try and determine what the issue may be. It turns out the e-mails were not being deleted from the server in the end, which is strange as we have not had problems with this up until this point.
I believe the issue could have been with a particular e-mail that was received that was causing an issue. I have removed all the e-mails from the server and then proceeded to delete the e-mails from osTicket and problem seems to have gone away.
tott, this may be a similar issue so I would recommend that you make sure your e-mails are being deleted from your server, otherwise they will keep appearing in osTicket.
If it is not removed from your server try deleting these directly from your e-mail server. Then try and delete the e-mail from osTicket.
If you continue to have the same database error as I did go in to your osTicket database and delete the tickets manually.
You will need to delete the tickets from two tables (ost_ticket and ost_ticket_message).
The message should now be completely removed and hopefully the issue will have gone away as it did with us.
(apologies for not explaining in German, unfortunately I cannot speak the language)