/go/smtpsync copies the global SMTP configuration database, /var/lib/sqlite/smtp.db, from this server to another GoAdmio server over SSH. Use it to keep a second server's SMTP settings the same as this one's, for example after you move accounts with copy or serversync. After the copy, the command runs vmail on the remote server, so the Postfix and Dovecot mail maps are rebuilt there. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
/go/smtpsync 203.0.113.10 'RemoteRootPassword'
Arguments
| Position | Argument | Required | Default | Notes |
|---|---|---|---|---|
| 1 | <remote-server> |
Yes | — | The host name or IP address of the other server. |
| 2 | <root-password> |
Yes | — | The root SSH password of the other server. Quote it in single quotes. |
| 3 | [ssh-port] |
No | 22 |
The SSH port of the other server. Pass it when the port was changed with port. |
Nothing is validated. A wrong server or password shows up only as an SSH or rsync error.
Examples
# Copy to a server on the default SSH port
/go/smtpsync 203.0.113.10 'RemoteRootPassword'
# Copy to a server whose SSH port is 2222
/go/smtpsync backup.example.com 'RemoteRootPassword' 2222
# Review recent calls (this log contains the passwords)
tail /var/log/go/smtpsync.log
Output
The first line says which server is being used:
Copying WA to 203.0.113.10...
[!NOTE]
The text says "WA", but the file copied is the SMTP database. The word is a leftover from a similar command and doesn’t affect what happens.
After that, rsync shows the file name and the transfer progress, then any output of vmail from the remote server. There is no final message, so you can’t tell from the output alone whether the copy worked. Check that the remote server’s /var/lib/sqlite/smtp.db has a recent modification time.
See the full reference at /go/smtpsync 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.
