Ok thanks for your response and quick customization of the script.Sorry, you're right Double-checked the code and found the bug. Please check if the following 0.0.4 version does the trick (it should):
Code:wget -O /usr/local/directadmin/scripts/dovecot_compress.sh https://custombuild.eu/dovecot_compress.sh
We could include it into the next release of DA then.
I did the test again today with the same start data (referring to my previous screenshot), the result is now as following:
* the other mailbox folders are taken and the compression is happening however it seems to be that the compressed emails in the tmp folder are not moved (tmp folder contains cur and new folder).
* The size before is now correct in this version.