I accidentally emptied my “/etc/postfix/virtual” file. How can I regenerate this file from Virtualmin’s own database? Is “virtualmin rebuild-maps --all-domains” the right command for this, and is it safe to run?
Wait, I thought postmap was the one for creating the .db file from the text file.
Doesn’t virtualmin rebuild-maps actually generate the text content itself by pulling data from Virtualmin’s own configs? If not, how am I supposed to fill that empty text file back up?
Exactly. So since my virtual text file is now empty, I need a way to refill it using Virtualmin’s own database.
Is virtualmin rebuild-maps --all-domains the right command to regenerate that text file content? Or is there another way to tell Virtualmin to write its current alias list back into /etc/postfix/virtual?
I think there’s a misunderstanding. I’m not trying to build the .db file from the text file. I know postmap does that.
My problem is the /etc/postfix/virtualtext file itself is empty. I need Virtualmin to look at its own database (where it stores alias/domain info) and rewrite the content into that empty text file. I believe virtualmin rebuild-maps --all-domains is designed to do this sync. Is that correct? If not, how can I trigger Virtualmin to ‘re-export’ its internal alias list back into the text file?
Thanks, but postmap -s only works if the .db file is intact. In my case, the .db file is also corrupted because the source text file was emptied. I don’t want to extract data from Postfix; I need Virtualmin to push its own internal data into Postfix.
I’m pretty sure virtualmin rebuild-maps --all-domains is the command that handles this sync by pulling from Virtualmin’s metadata. I just want to be 100% sure that running it won’t touch or break anything else outside of the /etc/postfix folder. That’s my main concern.
what size is your virtual.db? virtual.db doesn’t need virtual for postfix to work, its only use to build virtual.db, unless you did a rebuild after you lost the content of virtual (then your pretty much stuffed).
did you try running the command?
Vitualmin rebuld-maps would just use the postmap commands, its a script design to make life easier for virtuamin users, don’t overthink it.
Also Virtuamin is just GUI to configure your server, its not the server it dosn’t store that info in its config’s, its just reading from the postfix config files. If you stop Virtualmin your server still keeps running.
I remember losing a file in my /etc before and found that Virtualmin (or something) kept backups of the entire /etc folder for me… so I was able to restore… but I can’t remember what it was.