possible solution to problems with inboud emails and cases?

I know I wrote about my issue of having to babysit the inbound email process numerous time, but I may have solved my problem.
to put in context.
my instance monitor more than 10 email addresses and assign to specific users.
often the process hung with no reason, I was suspecting mal formed emails.
fiddling with inboundemail.php to trace the process in the log I discovered that most of the time the process was stopping at one of the email address specifically. but not much more clue.

A few weeks ago I came across a thread that mentioned that the process took a very long time while deleting the processed mail and I can confirm that.

But interesting enough I logged to each of the inbound email mailboxes and discovered that the one that was hanging the process most ofthen had a few thousand of deleted emails in the folder. Could it be related? I think so… this mailbox was hanging very often…
I emptied the deleted item folder and the process appeared to be quicker and more fluid.

So I did checked each of the mailboxes and cleaned what I could…
this action appeared to help the process a lot; it has been a few hours (yes I know early to say “Victory!”) and the process is running like clockworks!

So if your inbound emails have issues, check if you have emails in folders that should not be kept … and remove them…

I am running on IIS and MSSQL
the suitecrm version is not really relevant because this problem has been bugging me for very long time 7.x (or earlier?)… but I am running 7.8.13…

I hope this might help some of us…

Serge

Thank you for sharing your problem and solution…

For people running SugarCRM/SuiteCRM for years, it is always a good idea to watch the database closely and do regular maintenance. You might want to turn on “log slow queries” option and then after a week or so of normal usage, go in the logs and see which queries show up there. You probably have more places that could use a little cleaning.