How to move email messages from Inbox/Sent to Archive (per year)

First, create reference dates:

touch -d 20210101 /tmp/2021
touch -d 20220101 /tmp/2022

Find and Move messages

find ./ -newer /tmp/2021 -not -newer /tmp/2022 -exec mv -t /home/PATH_TO/Maildir/.Archives.2021.Sent/cur/ {} +

Did you find this article useful?