Add expunge-mailboxes.sh
This commit is contained in:
parent
8a9f082424
commit
721f9596b0
1 changed files with 11 additions and 0 deletions
11
aech/expunge-mailboxes.sh
Normal file
11
aech/expunge-mailboxes.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
DOVECOTCONTAINERID=`docker ps -qf name=dovecot-mailcow`
|
||||
|
||||
# Delete all user's mails in the junk folder that are older than 2 weeks
|
||||
docker exec ${DOVECOTCONTAINERID} doveadm expunge -A mailbox 'Junk' savedbefore 2w
|
||||
|
||||
# Delete all user's mails in the junk folder that are seen and not flagged and older than 72 hours
|
||||
docker exec ${DOVECOTCONTAINERID} doveadm expunge -A mailbox 'Junk' SEEN not FLAGGED not SINCE 72h
|
||||
|
||||
# Delete all user's mails in the trash folder that are seen and not flagged and older than 4 weeks
|
||||
docker exec ${DOVECOTCONTAINERID} doveadm expunge -A mailbox 'Trash' SEEN not FLAGGED not SINCE 4w
|
Loading…
Reference in a new issue