summaryrefslogtreecommitdiff
path: root/community-staging/courier-mta/courier-mta.install
diff options
context:
space:
mode:
Diffstat (limited to 'community-staging/courier-mta/courier-mta.install')
-rw-r--r--community-staging/courier-mta/courier-mta.install61
1 files changed, 61 insertions, 0 deletions
diff --git a/community-staging/courier-mta/courier-mta.install b/community-staging/courier-mta/courier-mta.install
new file mode 100644
index 000000000..b0d827e43
--- /dev/null
+++ b/community-staging/courier-mta/courier-mta.install
@@ -0,0 +1,61 @@
+# arg 1: the new package version
+post_install() {
+ cat << EOM
+ --> if you are using LDAP services to provide lookup in sqwebmail or aliases
+ --> then you have to install:
+ libldap
+EOM
+ # create the *.dat files
+ makealiases
+ makesmtpaccess
+}
+
+pre_upgrade() {
+ pre_remove $1
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ post_install $1
+ echo "Please migrate to the new daemon format:"
+ echo "/etc/rc.d/courier-imap has been split into separate daemons:"
+ echo " imapd, imapd-ssl, pop3d, pop3d-ssl"
+ echo "This elimates the need for /etc/conf.d/courier-imap"
+ echo "Update your /etc/rc.conf and manually add the desired daemons. Make sure"
+ echo "you first start authdaemond before any other of these daemons."
+ echo "Example prior to this change:"
+ echo " DAEMONS=( ... courier-mta ...)"
+ echo "Example after this change:"
+ echo " DAEMONS=( ... authdaemond courier esmtpd esmtpd-ssl imapd imapd-ssl"
+ echo " pop3d pop3d-ssl webmaild ... )"
+ echo "This allows better control over the daemons and will generate"
+ echo "correct entries in /run/daemons"
+ echo "An old configuration will keep working but please do migrate in time"
+ echo "as support for this will be removed some time in 2012."
+}
+
+
+pre_remove() {
+ # manual backup, since courier is always processing the whole directory
+ # - so it would process "system" AND "system.pacsave" -> bad
+ [ ! -d /etc/courier/_backup ] && mkdir /etc/courier/_backup
+ cp /etc/courier/aliases/system /etc/courier/_backup/aliases.system
+ cp /etc/courier/smtpaccess/default /etc/courier/_backup/smtpaccess.default
+ cat << EOM
+ --> the /etc/courier/aliases/system and the /etc/courier/smtpaccess/default
+ --> files have been backed up to /etc/courier/_backup since the *.pacsave
+ --> files cannot stay in place. Read about couriers alias handling from the
+ --> documentation!
+EOM
+}
+
+# arg 1: the old package version
+post_remove() {
+ /bin/true
+}
+
+op=$1
+shift
+
+$op $*