On 13 Feb 2019, at 11.22, Gandalf Corvotempesta via dovecot <dovecot@dovecot.org> wrote:

Hi to all
We have a maildir with about 180GB of emails.
We have to archive them to a structure like: .Archive.YYY./MM.folder

Are you aware of a script doing this ? I've found a perl script that
doesn't spit in year and month and a very, very, very, very, very old
python script that:
1) doesn't manage base64 encoded subject properly
2) doesn't work with python 3.x (that is able to manage base64 encoded
subject properly

Any idea ?

Maybe just simple scripting and doveadm move? There is even example at the bottom of the wikipage:
https://wiki2.dovecot.org/Tools/Doveadm/Move

Sami