~ubuntu-dev/ubuntu/lucid/dovecot/lucid-201002101918

« back to all changes in this revision

Viewing changes to debian/dovecot-common.postinst

  • Committer: Bazaar Package Importer
  • Author(s): CHuck Short, Chuck Short
  • Date: 2009-11-06 00:47:29 UTC
  • mfrom: (4.1.9 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091106004729-i39n7v9e7d4h51f6
Tags: 1:1.2.6-1ubuntu1
* Merge from debian testing, remaining changes:
  Add new binary pkg dovecot-postfix that integrates postfix and dovecot
  automatically: (LP: #164837)
  + debian/control:
    - add new binary with short description
    - set Architecture all for dovecot-postfix (LP: #329878)
  + debian/dovecot-postfix.postinst:
    - create initial certificate symlinks to snakeoil.
    - set up postfix with postconf to:
      - use Maildir/ as the default mailbox.
      - use dovecot as the sasl authentication server.
      - use dovecot LDA (deliver).
      - use tls for smtp{d} services.
    - fix certificates paths in postfix' main.cf
    - add reject_unauth_destination to postfix' recipient restrictions
    - add reject_unknown_sender_domain to postfix' sender restrictions
    - rename configuration name on remove, delete on purge
    - restart dovecot after linking certificates
    - handle use case when postfix is unconfigurated
   + debian/dovecot-postfix.dirs: create backup directory for postfix's configuration
   + restart postfix and dovecot.
   + debian/dovecot-postfix.postrm:
     - remove all dovecot related configuration from postfix.
     - restart postfix and dovecot.
   + debian/dovecot-common.init:
     - check if /etc/dovecot/dovecot-postfix.conf exists and use it
       as the configuration file if so.
   + debian/patches/warning-ubuntu-postfix.dpatch
     - add warning about dovecot-postfix.conf in dovecot default 
       configuration file
   + debian/patches/dovecot-postfix.conf.diff:
     - Ubuntu server custom changes to the default dovecot configuration for
       better interfation with postfix
     - enable sieve plugin
   + debian/patches/dovecot-postfix.conf.diff:
     + Ubuntu server custom changes to the default dovecot configuration for
       better integration with postfix:
       - enable imap, pop3, imaps, pop3s and managesieve by default.
       - enable dovecot LDA (deliver).
       - enable SASL auth socket in postfix private directory.
   + debian/rules:
     - copy, patch and install dovecot-postfix.conf in /etc/dovecot/.
     - build architecure independent packages too
   + Use Snakeoil SSL certificates by default.
     - debian/control: Depend on ssl-cert.
     - debian/patches/ssl-cert-snakeoil.dpatch: Change default SSL cert
       paths to snakeoil.
     - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
   + Add autopkgtest to debian/tests/*.
   + Fast TearDown: Update the lsb init header to not stop in level 6.
   + Add ufw integration:
     - Created debian/dovecot-common.ufw.profile.
     - debian/rules:
       + install profile
     - debian/control:
       + Suggest ufw
   + debian/{control,rules}: enable PIE hardening.
   + dovecot-imapd, dovecot-pop3: Replaces dovecot-common (<< 1:1.1). LP: #254721
   + debian/control:
     - Update Vcs-* headers.
   + debian/rules:
     - Create emtpy stamp.h.in files in dovecot-sieve/ and dovecot-managesieve/
       if they're not there since empty files are not included in the diff.gz 
       file.
   + Add SMTP-AUTH support for Outlook (login auth mechanism)
   + Dropped:
     - debian/patches/security-CVE-2009-3235: Applied upstream.
     - debian/patches/fix-pop3-assertion.dpatch: Applied upstream.
     - dovecot-sieve and dovecot-managesieve: Use the debian patches instead.

  [Chuck Short]
  - Updated dovecot-sieve to 0.1.13.
  - Updated dovecot-managesieve to 0.11.9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
  done
16
16
 
17
17
  if [ -n "`id -u imapd 2> /dev/null`" ]; then
18
 
    /usr/sbin/deluser imapd || true
19
 
    /usr/sbin/delgroup imapd || true
 
18
    deluser imapd || true
 
19
    delgroup imapd || true
20
20
  fi
21
21
 
22
22
  if [ -z "`id -u dovecot 2> /dev/null`" ]; then
23
 
    /usr/sbin/adduser --system --group --home /usr/lib/dovecot --gecos "Dovecot mail server" \
24
 
                      --disabled-password --quiet dovecot || true
 
23
    adduser --system --group --home /usr/lib/dovecot --gecos "Dovecot mail server" \
 
24
            --disabled-password --quiet dovecot || true
25
25
  fi
26
26
 
27
 
  # Fix permissions
28
 
  chmod 755 /var/run/dovecot
29
 
  chmod 750 /var/run/dovecot/login
30
 
  chgrp dovecot /var/run/dovecot/login
31
 
 
32
27
  ## SSL Certs
33
28
  # Certs and key file
34
29
  SSL_CERT=$( (grep -m 1 "ssl_cert_file" /etc/dovecot/dovecot.conf  || echo '/etc/ssl/certs/dovecot.pem') | cut -d'=' -f2)
35
30
  SSL_KEY=$( (grep -m 1 "ssl_key_file" /etc/dovecot/dovecot.conf || echo '/etc/ssl/private/dovecot.pem') | cut -d'=' -f2)
36
31
  
37
32
  # Generate new certs if needed
38
 
  if [ -e $SSL_CERT ] && [ -e $SSL_KEY ]; then
 
33
  if [ -e $SSL_CERT ] || [ -e $SSL_KEY ] || [ -n "$2" ]; then
39
34
    echo "You already have ssl certs for dovecot."
40
35
  else
41
36
    echo "Creating generic self-signed certificate: $SSL_CERT"
68
63
    fi
69
64
  fi
70
65
 
 
66
  # migration hooks
 
67
  if [ -f /etc/dovecot/dovecot.conf ] && grep -q default_mail_env /etc/dovecot/dovecot.conf; then
 
68
    sed -i -e 's/^default_mail_env/mail_location/' /etc/dovecot/dovecot.conf
 
69
  fi
71
70
 
72
71
fi
73
72