/go/restoremail rebuilds the list of email accounts of a domain from the mailbox folders on disk. Use it when the mail files are present but the accounts are missing from GoAdmio, for example after you restored a domain's files from a backup. It: It restores accounts only. Passwords, forwarding, autoresponders, and other settings are not restored (see What is not restored). Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Recreate the missing accounts of example.com
/go/restoremail example.com
# Then set passwords for the accounts
Set the passwords with mailpwd, because the recreated accounts do not get a password you know.
Options
This command has no options. It takes the domain as its only argument.
| Argument | Required | Default | Notes |
|---|---|---|---|
<domain> |
Yes | — | The domain whose mail folder is used. Pass it exactly as the folder is named in /home. |
Examples
# Recreate the missing accounts of a domain
/go/restoremail example.com
# See which mailbox folders exist on disk
ls /home/example.com/mail
# See which accounts GoAdmio now has for the domain
sudo sqlite3 /var/lib/sqlite/mail.db "select Email from Mail where Email like '%@example.com'"
Output
The command prints nothing when it works. There is no list of the accounts it created, so a quiet run is normal. Messages come only from errors, and from mail for each account it creates.
| Message | Meaning |
|---|---|
Domain <domain> not exists. |
/home/<domain>/mail is not a folder. This also appears if you pass no domain. |
Every run is also recorded in /var/log/go/restoremail.log.
See the full reference at /go/restoremail and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
