summarylogtreecommitdiffstats
path: root/courier-mta.install
blob: 03a37935f7a68ddcde044f53aa82986d5411cd4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
post_install() {
  #set up the /var/run directory
  systemd-tmpfiles --create /usr/lib/tmpfiles.d/courier-mta.conf

  # perform all the tasks required of a standard Courier install
  echo Performing install-configure...
  /usr/lib/courier/sysconftool /etc/courier/*.dist > /etc/courier/install-$1.log
  echo "...output saved to /etc/courier/install-$1.log"
  echo "Don't forget to configure an account to receive postmaster mail"
  makealiases
  makesmtpaccess
  /usr/bin/mkdhparams
}

pre_upgrade() {
  # the file courier-imapd.conf is renamed to courier-mta.conf from version 0.77.0-2
  [ -f /usr/lib/tmpfiles.d/courier-imapd.conf ] && rm -f /usr/lib/tmpfiles.d/courier-imapd.conf
}

post_upgrade() {
  echo Performing install-configure...
  /usr/lib/courier/sysconftool /etc/courier/*.dist > /etc/courier/upgrade-$1.log
  echo "...output saved to /etc/courier/upgrade-$1.log"
}

pre_remove() {
  # there may be many files not part of the original installation that would be useful to save
  # so save the whole configuration directory rather than try to list all possibilities
  # in backup().
  mv -f /etc/courier /etc/courier-$1
  echo "/etc/courier has been saved as /etc/courier-$1 - you may remove this folder if you wish."

  # clean up temporary storage
  rm -rf /run/courier /var/spool/courier
}