Skip to main content

How to uninstall

Follow these steps in order to fully remove MSH Zimbra Rules from the server.

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.

warning

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.

note

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-web.service

4. Disable the services

Prevent the services from starting automatically on boot:

sudo systemctl disable msh-zr-milter.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 database:

sudo rm -rf /opt/msh-zr
note

The database /opt/msh-zr/etc/msh-zr.db holds all your rules, users and settings. Back it up first if you may want to restore the installation later.

7. Remove the service user

sudo userdel msh