Hi everyone,
I’m having a problem with my Mailcow setup. I wrote a small script that is supposed to empty the Junk and Trash folders daily via cronjob:
#!/bin/bash
cd /opt/mailcow-dockerized
# General
docker compose exec dovecot-mailcow doveadm expunge -A mailbox 'Junk' savedbefore 14d
docker-compose exec dovecot-mailcow doveadm expunge -A mailbox 'Trash' savedbefore 30d
# Service Accounts
docker-compose exec dovecot-mailcow doveadm expunge -u 'noreply-dmarc@domi-btnr.dev' mailbox % before 30d
docker-compose exec dovecot-mailcow doveadm expunge -u 'status@domi-btnr.dev' mailbox % before 30d
docker-compose exec dovecot-mailcow doveadm expunge -u 'vault@domi-btnr.dev' mailbox % before 30d
docker-compose exec dovecot-mailcow doveadm expunge -u 'nas@domi-btnr.dev' mailbox % before 30d
The problem is that it’s simply not working. My Trash folder still contains emails that are over 4 months old. When I run the doveadm expunge
commands manually directly in the shell, nothing happens either.
I followed this Article: https://docs.mailcow.email/manual-guides/Dovecot/u_e-dovecot-expunge/
Does anyone have an idea what could be causing this?
Thanks in advance for your help!