postfix bug in the Virtualmin backup/restore process


I found a postfix bug in the Virtualmin backup/restore process.

I used the following bash shell command on the old server:

# virtualmin backup-domain --dest /backup/full/ --all-domains --all-features --newformat --all-virtualmin

and ran the following command on the new server:

# virtualmin restore-domain --source /backup/full/virtualmin.tar.gz --all-virtualmin
# virtualmin restore-domain --source /backup/full/ --all-domains --all-features

GOOD NEWS: The entire backup/restore went perfectly.

BAD NEWS: The restore command *also* changed the new server /etc/postfix/ file.

Instead of my new server having these lines:

myhostname =
mydestination =,,, localhost

it was changed to this:

myhostname =
mydestination =,,, localhost

So all my email started bouncing with the "looping back onto itself" errors.



Was or one of the domains in the backup?

No, but close...

The actually domains were like this:

On, there was a virtual server called

When was restored to (migrating with it) then I had the in the /etc/postfix/ file instead of

Actually, I see the issue here - if you use the --all-virtualmin flag, the backup will contain the Postfix configuration as well, which and . This is useful if you want to create a backup for restoring locally, but as you saw it may cause problems when restoring on a new machine.

The solution is to limit the global settings you want to backup. Instead of the --all-virtualmin flag, you could instead use :

--virtualmin config --virtualmin templates --virtualmin resellers --virtualmin email --virtualmin custom --virtualmin scripts --virtualmin styles --virtualmin scheds --virtualmin chroot

Where can I find a list of all possible "--virtualmin ???" options? I tried HELP, but it only listed "config".

Oh, I found them, had to put in a bad --virtualmin jjj and it printed the options.

For the GPL version, options are:

config templates email custom scripts scheds chroot mailserver


The ones he mentioned above are 9 out of the 10 available --virtualmin options.

The only one he left out was "--virtualmin mailserver", but that's not one you'd want to use in this case.