Symptoms
Some customers report that there are issues when they attempt to remove older email, there are messages that are created on a certain day or earlier that should have been removed but never are.
Description
Often the caused by the timestamp of the file not matching the "savedbefore" time that is expected because if the file is moved or otherwise modified, the timestamp is modified.
SAVEDBEFORE date specification Matches messages which were saved before date specification.
For more information about this, please refer to the link below.
https://wiki2.dovecot.org/Tools/Doveadm/SearchQuery
Workaround
Instead of using savedbefore, use sentbefore as this will read the mail headers of the message and use the actual "received" date which does not change even if the file is moved
SENTBEFORE date specificationMatches messages with a Date: header before date specification.