sorry, but I can not reproduce the underling issue here.
1) I have create the domain "šđžčć.com"
2) I have added the email address test@šđžčć.com
3) I was able to login into this account without any issues via Roundcube (1.6.6), Snappymail (2.36.0), or the outdated RainLoop and could access existing emails.
The path is "/var/mail/vhosts/xn--4dall33a0e.com/test/"
Mit freundlichen Grüßen / Best regards
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
I had issues with IMAP folders with those chars, not actual domains/usernames.
Actually those folders were migrated from Plesk based hosting (not via your script but with simple rsync) and issue arise until I added this to dovecot. Not sure what would it be if I simply created those folders on Keyhelp via IMAP client (or Roundcube)