Exporting e-mails with username.domain format and re-importing them with username@domain format

One of our clients went with ‘username.domain’ format initially because of http://www.virtualmin.com/documentation/id,frequently_asked_questions/#what_s_the_deal_with_in_mailbox_usernames, created lot’s of e-mail accounts and has solid amount of e-mail data. Then he decided to switch to ‘username@domain’ format instead. We have re-configured Virtualmin and now it is creating all the new e-mail accounts in the desired format, however we don’t know how to turn old mail boxes into new format. Is there a safe path to address this issue? Maybe there is a way to export old mails and import then into newly created mail account with desired username format?


There unfortunately isn’t a good way to change existing email addresses.

The one thing I think might work, would be to generate a backup of the domain, and once the email username format is at the correct setting, to import the backup. I think importing the backup will re-generate the email usernames.


Thanks Eric,

I knew of that method, but was reluctant because the website is quite large and it would be more troublesome to go that way than just convincing our client to continue to use both formats for now. To say frankly I find it not very much logical to go through backing up and re-importing the whole website to get only small fraction of it (mail accounts) to desired format. This is especially problematic for large websites. So I believe eventually Virtualmin should develop some method to change mail address formats for existing account without touching the document root of the websites.


I tried backing up a virtual server on the old server and restoring to the new server, but the username format remained the same.

I first modified the default template “Format for usernames that include domain” to “username@domain”.

I didn’t see any settings that I should change during the import.

I would like the imported user account login names to be “username@domain.tld” format.

Thanks much,