The is some wrong logic in Restore Virtual Server regarding Inbox mail files if they are not in the default /home/<virtservadmin>/homes/ directory.
Mine are in /var/spool/mail/.
The Restore Virtual Server handles such case.
But here is the problem:
If I backup a virtual server with explicitly checking the option to backup mail files too, the backup file correctly contains both Sent mail (/home/<virtservadmin>/homes/<virtservuser>/mail/ for all virtservusers ) and Received mail (Inbox) ( /var/spool/mail/<virtservuser> ).
Now when I use Restore Virtual Server to migrate/move a virtual server to a pristine new physcial/vps server and I restore with the default restore settings, I get the Sent mail restored, but not the Inboxes.
I played a bit to get to the root of the problem and found the following:
By default, Restore Virtual Server has its Features and settings section not expanded.
When expanded, it shows that by default radio-button Restore all features is chosen.
Next to it sits its alternative radio-button - Only those selected below.
Underneath them is a list of checkboxes - per feature, none checked by default.
When I see that and restore, I logically expect everything from the backup file to be restored since Restore all features is chosen.
But as I pointed above, in this process Sent mail files get restored, but Inbox mail files not in "home" dir, do not get restored.
I found that get the Inbox restored to, I need to check the designated checkbox Restore mail files.
But that goes contrary to the logic that Restore all features is chosen: why after that I need to check a specific checkbox underneath it?
I would highly recommend improving VM code as follows:
In case of restoring on the same server (not my case of migrating/moving), obviously there are legitimate reasons to prevent mail files restore. The logic is that the existing mail files might contain newer mail, arrived between the backup and restore times.
We might be restoring because we screw up something else (not mail).
But in that case, the logic for both Sent and Inbox should be the same: I either want to restore both, or not restore neither one.
Based on #1, the Restore mail files should not be underneath the alternative options to restore all or only chosen features.
It should be placed separate, e.g. before the alternative for choosing scope of restored features.
And by default, it might be good to be not checked.
Thus there won’t be confusion if they get restored for neither operation - restore to an existing virt.server, or to a pristine new one.
Another logic to handle this might be on checking the presense of the mail files: if not present, restore them anyway. Means they either got deleted or this is a move/migration to another physical server.