Sorry that I need to come back to this again
With the help of the different cleanup scripts db-remove-orphaned-attachements and also the discussed and also removing unconnected files in the attachment directory with remove-orphaned-attachement-files it seems that at least I have no mis-connected mail to content on IMAP level anymore.
However, the situation is still not ok: despite having executed optimize-imap.py, my imap based client does NOT contain all mails which are eg in the inbox or sent folder of my web app client.
Is there any hint how to rebuild the relation (the PR_EC_IMAP_EMAIL) from scratch to all mails in the database? Or did I misunderstood something here …
Any hint highly appreciated …
Br br