webmin supports fetchmail, has never failed me for importing email from other hosts. just fix configuration either by webmin module, or by hand (.fetchmailrc).
fixes permissions correctly, can run for as long as you’d like automatically to also fetch newer messages.
if you want to copy folders/maildir, then another way :
create user(s) on virtualmin
copy all maildir folders (cur, new, tmp, etc…) to new folders
Fetchmail is great for end users. That’s a different use case.
I’m talking about importing all emails from another dovecot-based system, preserving all flags, etc… and ensuring everything is set up correctly. Just for example, the alternate method provided by dimitrist is incorrect on my debian 10-based system:
Files are not owned by email:vserveruser but by vserveruser:vserveruser
Location of Maildir folder is also system-config-dependent.
doveadm import takes care of all that for us
Correctly imports to the right place
Sets permissions properly
Creates/preserves indexes as needed
That’s why I like it better than hassling through even more details.