Skip to main content
Version: 1.4

Multi server

This page removes MSH Zimbra Rules from a multi-server installation. On a single server, see Single server.

Remove it in this order:

  1. The zimlets and the Zimbra extension, from the mailbox servers.
  2. Every MTA server.
  3. The web admin server, last.

To take only one MTA server out and keep the others, run Every MTA server on that server only, then remove it on the Servers page of the web admin.

The zimlets and the Zimbra extension, on the mailbox servers​

Skip this if you did not install them with Zimlets configuration.

Commands​

On one mailbox server:

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'

On every mailbox server:

sudo rm -rf /opt/zimbra/lib/ext/msh-zr /opt/zimbra/conf/msh-zr-extension.properties
sudo su - zimbra -c 'zmmailboxdctl restart'

Description​

Run the zmzimletctl commands on one mailbox server. They 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. Zimbra removes it from all mailbox servers:

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.

Remove the Zimbra extension and its configuration, on every mailbox server:

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

Restart mailboxd as the zimbra user, on every mailbox server, so it unloads the extension:

sudo su - zimbra -c 'zmmailboxdctl restart'

If you opened the web admin port 9010 to the mailbox servers, close it again on the web admin server.

Every MTA server​

Repeat this section on each MTA server.

Commands​

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 systemctl stop msh-zr-milter.service msh-zr-node.service
sudo systemctl disable msh-zr-milter.service msh-zr-node.service
sudo rm -rf /opt/msh-zr
sudo systemctl daemon-reload
sudo userdel msh

Description​

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

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 when you registered the milter, 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 services and the files​

Stop the node and the milter:

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

Prevent them 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

Delete all application files, including the node's local copy of the rules:

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

The web admin server​

Remove the web admin last, once no MTA server uses it any more.

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​

sudo systemctl stop msh-zr-web.service
sudo systemctl disable msh-zr-web.service
sudo rm -rf /opt/msh-zr
sudo systemctl daemon-reload
sudo userdel msh

Description​

The web admin server has no Zimbra MTA, so there is no milter to detach.

Stop the web admin:

sudo systemctl stop msh-zr-web.service

Prevent it from starting on boot. This also removes the link to the unit file created during the installation:

sudo systemctl disable msh-zr-web.service

Delete all application files, including the configuration and the databases (see the note above):

sudo rm -rf /opt/msh-zr

Reload systemd, so it forgets the removed service:

sudo systemctl daemon-reload

Remove the msh service user:

sudo userdel msh

If you opened ports 9010 or 9012 in a firewall for MSH Zimbra Rules, close them again.