Hotfix for courier-mta on Ubuntu 16.04

On Ubuntu 16.04 the installation of the Courier MTA package fails  with the following error message:

courier-mta.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install enable courier-mta
insserv: script courier-mta: service courier-mta already provided!
insserv: exiting now!

The hotfix for this issue is to change the LSB headers for the old style init file /etc/init.d/courier-mta-ssl:

--- courier-mta-ssl.init	2016-05-24 21:55:22.240328981 +0200
+++ /etc/init.d/courier-mta-ssl	2016-05-24 22:46:20.037440188 +0200
@@ -1,12 +1,12 @@
 #! /bin/sh -e
-# Provides:          courier-mta mail-transport-agent
+# Provides:          courier-mta-ssl mail-transport-agent-ssl
 # Required-Start:    $remote_fs $syslog
 # Required-Stop:     $remote_fs $syslog
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
-# Short-Description: courier-mta Mail Transport Agent
-# Description:       courier-mta is a Mail Transport agent
+# Short-Description: courier-mta-ssl Mail Transport Agent
+# Description:       courier-mta-ssl is a Mail Transport agent

The installation might already be in an inconsistent state when you observe the mentioned error, because courier could not be fully installed  and parts of postfix configuration such as its systemd config are still present in the system.

So to finally fix it, run

apt-get purge postfix

to get rid of any postfix init.d config files.

The better solution seems to be to switch to the updated upstream (debian) version which also included improved init files, see this github issue.