Skip to main content
Version: 1.4

Single server

This page removes MSH Zimbra Rules from a single Zimbra server. For a Zimbra installation with several servers, see Multi server.

note

/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. Both are deleted with the installation. Export a backup on the Backup & Restore page, or copy /opt/msh-zr/etc, first if you may want to restore the installation later.

Commands​

Here are the commands needed to remove the application. They can be invoked one by one in the terminal. If you would like to have a description of each command, please refer to the Description section below.

sudo su - zimbra -c 'zmzimletctl undeploy com_mshsoftware_change_user_info'
sudo su - zimbra -c 'zmzimletctl undeploy mshsoftware-zimlet-change-user-info'
sudo su - zimbra -c 'zmzimletctl undeploy com_mshsoftware_message_notices'
sudo su - zimbra -c 'zmzimletctl undeploy mshsoftware-zimlet-message-notices'
sudo su - zimbra -c 'zmprov ms $(zmhostname) zimbraAmavisEnableDKIMVerification ""'
sudo rm -f /opt/zimbra/data/spamassassin/localrules/zz-msh-dkim.cf
sudo su - zimbra -c 'zmamavisdctl restart'
sudo su - zimbra -c 'zmprov ms $(zmhostname) zimbraMtaSmtpdMilters ""'
sudo su - zimbra -c 'zmprov ms $(zmhostname) zimbraMtaNonSmtpdMilters ""'
sudo su - zimbra -c 'zmprov ms $(zmhostname) zimbraMtaMilterDefaultAction ""'
sudo su - zimbra -c 'zmmtactl reload'
sudo rm -rf /opt/zimbra/lib/ext/msh-zr /opt/zimbra/conf/msh-zr-extension.properties
sudo su - zimbra -c 'zmmailboxdctl restart'
sudo systemctl stop msh-zr-milter.service msh-zr-node.service msh-zr-web.service
sudo systemctl disable msh-zr-milter.service msh-zr-node.service msh-zr-web.service
sudo rm -rf /opt/msh-zr
sudo systemctl daemon-reload
sudo userdel msh

Description​

Remove the zimlets​

Skip the zmzimletctl commands if you did not install the zimlets with Zimlet configuration.

All zm... commands run as the zimbra user, so each one switches to it with sudo su - zimbra -c.

Undeploy Change User Info for the Classic web client:

sudo su - zimbra -c 'zmzimletctl undeploy com_mshsoftware_change_user_info'

Undeploy Change User Info for the Modern web client:

sudo su - zimbra -c 'zmzimletctl undeploy mshsoftware-zimlet-change-user-info'

Undeploy Message Notices for the Classic web client:

sudo su - zimbra -c 'zmzimletctl undeploy com_mshsoftware_message_notices'

Undeploy Message Notices for the Modern web client:

sudo su - zimbra -c 'zmzimletctl undeploy mshsoftware-zimlet-message-notices'

Skip the zmzimletctl commands of a zimlet you did not deploy.

Undo the DKIM configuration​

Skip this if you did not do the DKIM configuration. Without the milter, nothing verifies DKIM before SpamAssassin any more, so Amavis has to verify it again.

Turn the DKIM verification of Amavis on again. Setting the attribute to an empty value removes it from the server entry, so Zimbra falls back to its default, on:

sudo su - zimbra -c 'zmprov ms $(zmhostname) zimbraAmavisEnableDKIMVerification ""'

Remove the SpamAssassin rules file:

sudo rm -f /opt/zimbra/data/spamassassin/localrules/zz-msh-dkim.cf

Restart Amavis, so it reads the rules without the file:

sudo su - zimbra -c 'zmamavisdctl restart'

To verify, run sudo grep enable_dkim_verification /opt/zimbra/conf/amavisd.conf after a minute: the line must start with $enable_dkim_verification = 1;.

Detach the milter from the Zimbra MTA​

Clear the milter attributes that were set during Milter configuration, so Zimbra stops routing mail through the milter. 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.

sudo su - zimbra -c 'zmprov ms $(zmhostname) zimbraMtaSmtpdMilters ""'
sudo su - zimbra -c 'zmprov ms $(zmhostname) zimbraMtaNonSmtpdMilters ""'
sudo su - zimbra -c 'zmprov ms $(zmhostname) zimbraMtaMilterDefaultAction ""'
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:

sudo su - zimbra -c '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:

sudo su - zimbra -c 'zmprov ms $(zmhostname) zimbraMilterServerEnabled FALSE'
sudo su - zimbra -c 'zmmilterctl stop'

Reload the Zimbra MTA, so Postfix regenerates main.cf without the milter:

sudo su - zimbra -c 'zmmtactl reload'

To verify, run postconf smtpd_milters non_smtpd_milters milter_default_action: inet:localhost:9011 must no longer appear in the output.

Remove the Zimbra extension​

Skip this if you did not install the Zimbra extension.

Remove the extension and its configuration:

sudo rm -rf /opt/zimbra/lib/ext/msh-zr /opt/zimbra/conf/msh-zr-extension.properties

Restart mailboxd as the zimbra user, so it unloads the extension:

sudo su - zimbra -c 'zmmailboxdctl restart'

Remove the services and the files​

Stop the services:

sudo systemctl stop msh-zr-milter.service msh-zr-node.service msh-zr-web.service

Prevent the services from starting on boot. This also removes the links to the unit files created during the installation:

sudo systemctl disable msh-zr-milter.service msh-zr-node.service msh-zr-web.service

Delete all application files, including the configuration and the databases (see the note at the top of this page):

sudo rm -rf /opt/msh-zr

Reload systemd, so it forgets the removed services:

sudo systemctl daemon-reload

Remove the msh service user:

sudo userdel msh