Following a previous suggestion I'd received to turn on autoexpunge (https://dovecot.org/pipermail/dovecot/2020-February/118281.html), I'm now trying to confirm whether or not it is doing what I expect it to do. I've set the expiration to be 12 weeks (as shown below in the config) but a lot of the mailboxes have email in them that is much older. Reading http://dovecot.2317879.n4.nabble.com/Dovecot-2-2-20-autoexpunge-td54644.html, I've tried using "doveadm search -u user mailbox INBOX savedbefore 2w" to see if it finds any email that is older than 2 weeks (just as a test) and it doesn't. If I change "savedbefore" to be "sentbefore" then it works. If "autoexpunge" is dependent on "savedbefore" working then what do I need to do to fix this? Thanks. Regards Philip Below is the output of doveconf -n: # 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.21 (92477967) # OS: Linux 4.15.0-1041-aws x86_64 Ubuntu 18.04.3 LTS auth_username_format = %Ln auth_verbose = yes disable_plaintext_auth = no listen = 127.0.0.1 mail_location = mbox:~/mail:INBOX=/var/mail/%u mail_privileged_group = mail mailbox_list_index = yes namespace inbox { inbox = yes location mailbox Drafts { special_use = \Drafts } mailbox INBOX { autoexpunge = 12 weeks } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix } passdb { driver = pam } protocols = " imap lmtp" service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { group = postfix mode = 0600 user = postfix } } ssl = no ssl_cert = </etc/dovecot/private/dovecot.pem ssl_client_ca_dir = /etc/ssl/certs ssl_key = # hidden, use -P to show it userdb { driver = passwd }