How to uninstall
Follow these steps in order on every host where MSH Zimbra Rules is installed. In a multi-server installation, uninstall the MTA servers first and the web admin server last.
To take only one MTA server out of a multi-server installation, run the steps below on that host, then remove it on the Servers page of the web admin.
1. Detach the milter from the Zimbra MTA
Clear the milter attributes that were set during Zimbra configuration, so Zimbra stops routing mail through the service. Run as the zimbra user:
sudo su - zimbra
zmprov ms $(zmhostname) zimbraMtaSmtpdMilters ""
zmprov ms $(zmhostname) zimbraMtaNonSmtpdMilters ""
zmprov ms $(zmhostname) zimbraMtaMilterDefaultAction ""
Setting an attribute to an empty value with zmprov ms removes it from the server entry, so Zimbra falls back to its default for that setting.
If zimbraMtaSmtpdMilters also contains Zimbra's own milter (e.g. inet:localhost:7026, see the caveats), do not clear the attribute. Instead, set it again with only the MSH entry removed:
zmprov ms $(zmhostname) zimbraMtaSmtpdMilters "inet:localhost:7026"
Check the current value first with zmprov gs $(zmhostname) zimbraMtaSmtpdMilters.
Zimbra's built-in milter server (zimbraMilterServerEnabled) was enabled during installation only as a workaround for Zimbra Bug 97706. Leave it enabled if you use it for distribution-list access control; otherwise you can switch it off again:
zmprov ms $(zmhostname) zimbraMilterServerEnabled FALSE
zmmilterctl stop
2. Reload the Zimbra MTA
Apply the configuration change so Postfix regenerates main.cf without the milter (still as the zimbra user):
zmmtactl reload
Verify the milter is gone:
postconf smtpd_milters non_smtpd_milters milter_default_action
inet:localhost:7080 must no longer appear in the output.
3. Stop the services
sudo systemctl stop msh-zr-milter.service msh-zr-node.service msh-zr-web.service
In a multi-server installation each host runs only some of these services. systemd reports the others as not loaded, which you can ignore. On the web admin server, step 1 and 2 do not apply: it has no Zimbra MTA.
4. Disable the services
Prevent the services from starting automatically on boot:
sudo systemctl disable msh-zr-milter.service msh-zr-node.service msh-zr-web.service
5. Reload the systemd daemon
Notify systemd that the unit files have been removed:
sudo systemctl daemon-reload
6. Remove the installation directory
Delete all application files, including the configuration and the databases:
sudo rm -rf /opt/msh-zr
On the web admin server (the Zimbra server on a single server), /opt/msh-zr/etc/msh-zr-master.db holds all your rules and settings and /opt/msh-zr/etc/msh-zr-web.db the servers, web admin users and directory service settings. Export a backup on the Backup & Restore page, or copy /opt/msh-zr/etc, first if you may want to restore the installation later.
7. Remove the service user
sudo userdel msh