It took me a while to understand, but I now know the exact reason for the problem.
It is in fact courier-imap which automatically deletes mails from the trash depending on their age. But what I didn’t understand was the erasure criterion, it uses CTIME and not MTIME to get the date it was moved to the trash.
cat /etc/courier/imapd | grep EMPTYTRASH
This option allows you to automatically delete mails moved to the trash 7 days ago.
Sorry for the noise.