Edit config file
cd /etc/dovecot/conf.d/15-mailboxes.conf
Change by adding autoexpunge = 30d. e.g. (30d=30days):
mailbox INBOX {
auto = subscribe
autoexpunge = 30d
}
mailbox Spam {
special_use = \Junk
auto = subscribe
autoexpunge = 7d
}
mailbox Drafts {
special_use = \Drafts
auto = subscribe
autoexpunge = 30d
}
mailbox Sent {
special_use = \Sent
auto = subscribe
autoexpunge = 30d
}
}
p.s. It will only delete new mails existing ones won’t be deleted.
admin