Debian

Available patches from Ubuntu

To see Ubuntu differences wrt. to Debian, write down a grep-dctrl query identifying the packages you're interested in:
grep-dctrl -n -sPackage Sources.Debian
(e.g. -FPackage linux-ntfs or linux-ntfs)

Modified packages are listed below:

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: dovecot

dovecot (1:2.2.25-1ubuntu2) zesty; urgency=medium * Update "general" dep8 test with various cleanups, bugfixes and conversion to Python 3. Since it now uses the "service" wrapper, the test must additionally depend on init-system-helpers. -- Robie Basak <robie.basak@ubuntu.com> Tue, 08 Nov 2016 13:37:08 +0000 dovecot (1:2.2.25-1ubuntu1) zesty; urgency=medium * Merge with Debian (LP: #1633220); Remaining Changes: + Add updated autopkgtest to debian/tests/*. + Drop build dependency on libstemmer-dev (universe) + Use Snakeoil SSL certificates by default - d/control: Depend on ssl-cert + Add mail-stack-delivery - add package in d/rules, d/control - add d/*mail-stack-delivery* maintainer scripts and default conf - d/mail-stack-delivery.preinst: Move previously installed backups and config files to a new package namespace. - d/mail-stack-delivery.README.Debian clarified use of configuration files + Disable dovecot-lucene plugin as it had various issues, has universe dependencies and is deprecated in favor of solr anyway. + handle conffile removal of /etc/init/dovecot.conf (due to dropping upstart). Can be removed once no upgrade path from <yakkety is left. * Added changes: + Fix FTBFS of dovecot 2.2.25 in Ubuntu due to being incompatible with -Bsymbolic-functions linker flag (LP: #1636781). * Dropped Changes as they got accepted in Debian: + add lsb base dependency to ensure debian/dovecot-core.dovecot.init is working correctly + Add ufw integration: - d/dovecot-core.ufw.profile: new ufw profile. - d/rules: install profile in dovecot-core. - d/control: dovecot-core - suggest ufw. + Add apport hook: - d/rules, d/source_dovecot.py + Remove lintian override for drac -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 25 Oct 2016 13:12:40 +0200

Modifications :
  1. Download patch debian/mail-stack-delivery.postinst

    --- 1:2.2.25-1/debian/mail-stack-delivery.postinst 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/mail-stack-delivery.postinst 2016-11-08 13:37:25.000000000 +0000 @@ -0,0 +1,91 @@ +#!/bin/sh + +set -e + +POSTFIX_BCKFILE="/var/backups/mail-stack-delivery/main.cf-backup" + +set_postfix_option() { + opt="$1" + # Backup the existion value of the option + postconf $(echo ${opt} | cut -d= -f1) >> ${POSTFIX_BCKFILE} || true + # Set the new value of the option + postconf -e "${opt}" + echo -n '.' +} + +if [ "$1" = "configure" ]; then + # Create initial symlinks for certificates + SSL_CERT=$( (grep -m 1 "ssl_cert_file" /etc/dovecot/conf.d/10-ssl.conf || echo '/etc/dovecot/dovecot.pem') | cut -d'=' -f2) + SSL_KEY=$( (grep -m 1 "ssl_key_file" /etc/dovecot/conf.d/10-ssl.conf || echo '/etc/dovecot/private/dovecot.pem') | cut -d'=' -f2) + + if [ ! -e "${SSL_KEY}" ]; then + ln -s /etc/ssl/private/ssl-cert-snakeoil.key ${SSL_KEY} + fi + if [ ! -e "${SSL_CERT}" ]; then + ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem ${SSL_CERT} + fi + # Configure postfix either on new install + # or if the postfix backup file is no longer there + # (only deleted when the pkg is removed) + if [ -f "/etc/postfix/main.cf" ]; then + if [ -e "$POSTFIX_BCKFILE" ]; then + cp $POSTFIX_BCKFILE ${POSTFIX_BCKFILE}-$(date +%Y%m%d%H%M) + fi + if [ -z "$2" -o ! -e "$POSTFIX_BCKFILE" ]; then + if which postconf >/dev/null; then + # Setup postfix + echo 'Mail stack delivery changes some postfix settings.' + echo 'Old values are stored in '$POSTFIX_BCKFILE'.' + echo 'Feel free to revert any of them when the process is done.' + echo -n 'Configuring postfix for mail-stack-delivery integration: ' + set_postfix_option "home_mailbox = Maildir/" + set_postfix_option "smtpd_sasl_auth_enable = yes" + set_postfix_option "smtpd_sasl_type = dovecot" + set_postfix_option "smtpd_sasl_path = private/dovecot-auth" + set_postfix_option "smtpd_sasl_authenticated_header = yes" + set_postfix_option "smtpd_sasl_security_options = noanonymous" + set_postfix_option "smtpd_sasl_local_domain = \$myhostname" + set_postfix_option "broken_sasl_auth_clients = yes" + set_postfix_option "smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination" + set_postfix_option "smtpd_sender_restrictions = reject_unknown_sender_domain" + set_postfix_option "mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -m \"\${EXTENSION}\"" + set_postfix_option "smtpd_tls_cert_file = ${SSL_CERT}" + set_postfix_option "smtpd_tls_key_file = ${SSL_KEY}" + set_postfix_option "smtpd_use_tls = yes" + set_postfix_option "smtp_use_tls = yes" + set_postfix_option "smtpd_tls_received_header = yes" + set_postfix_option "smtpd_tls_mandatory_protocols = SSLv3, TLSv1" + set_postfix_option "smtpd_tls_mandatory_ciphers = medium" + set_postfix_option "smtpd_tls_auth_only = yes" + set_postfix_option "tls_random_source = dev:/dev/urandom" + echo ' done.' + fi + fi + else + echo "" + echo "Postfix not configured. Run" + echo "sudo dpkg-reconfigure postfix and choose" + echo "the type of mail server. Then run" + echo "sudo dpkg-reconfigure mail-stack-delivery to" + echo "finish mail-stack-delivery installation." + echo "" + fi + + if [ -x "/etc/init.d/dovecot" ]; then + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d dovecot restart + else + service dovecot restart + fi + fi + if [ -x "/etc/init.d/postfix" ]; then + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d postfix restart + else + service postfix restart + fi + fi + +fi + +#DEBHELPER#
  2. Download patch debian/mail-stack-delivery.README.Debian

    --- 1:2.2.25-1/debian/mail-stack-delivery.README.Debian 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/mail-stack-delivery.README.Debian 2016-11-08 13:37:25.000000000 +0000 @@ -0,0 +1,24 @@ +Introduction +------------------- + +Mail-stack-delivery will not install any binary or library files. This package +contains only configuration file /etc/dovecot/mail-stack-delivery.conf with +configuration prerpared by Ubuntu Server Team. + +The matching configuration for dovecot is placed in: + /etc/dovecot/conf.d/99-mail-stack-delivery.conf + +During installation of package, it modifies postfix's configuration and +stores original version of /etc/postfix/main.cf in /var/backup/mail-stack-delivery. + +Features of mail-stack-delivery: +---------------------------- + +- IMAP4rev1 and POP3, including support for TLS and SSL +- SMTP, including support for TLS and SSL +- support for sieve scripting +- managesieve for managing sieve scripts directly on server +- dovecot MDA, including extensions separated with '+' +- Maildir storage engine +- SASL authentication (plain and login) +- support only for medium and high TLS/SSL ciphers
  3. Download patch debian/tests/testlib_dovecot.py

    --- 1:2.2.25-1/debian/tests/testlib_dovecot.py 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/tests/testlib_dovecot.py 2016-11-08 13:37:25.000000000 +0000 @@ -0,0 +1,122 @@ +#!/usr/bin/python3 +''' + Packages required: dovecot-imapd dovecot-pop3d +''' + +import subprocess, shutil, grp, os, os.path, sys, time + +class Dovecot: + def get_mailbox(self): + return self.mailbox + + def __init__(self,user,config=None): + '''Create test scenario. + + dovecot is configured for all protocols (imap[s] and pop3[s]), a test + user is set up, and /var/mail/$user contains an unread and a read mail. + ''' + + self.old_version = False + if config == None: + config=''' +protocols = imap pop3 +log_timestamp = "%Y-%m-%d %H:%M:%S " +mail_privileged_group = mail +managesieve_notify_capability = mailto +managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext +mmap_disable = yes +ssl = yes +ssl_cert = </etc/dovecot/dovecot.pem +ssl_key = </etc/dovecot/private/dovecot.pem +auth_mechanisms = PLAIN +mail_location = mbox:~/mail:INBOX=/var/mail/%u +service auth { + user = root +} +protocol pop3 { + pop3_uidl_format = %08Xu%08Xv +} +userdb { + driver = passwd +} +passdb { + driver = passwd-file + args = username_format=%n scheme=PLAIN /etc/dovecot/test.passwd +} +''' + + # make sure that /etc/inetd.conf exists to avoid init script errors + self.created_inetdconf = False + if not os.path.exists('/etc/inetd.conf'): + open('/etc/inetd.conf', 'a').close() + self.created_inetdconf = True + + # configure and restart dovecot + if not os.path.exists('/etc/dovecot/dovecot.conf.autotest'): + shutil.copyfile('/etc/dovecot/dovecot.conf', '/etc/dovecot/dovecot.conf.autotest') + with open('/etc/dovecot/dovecot.conf', 'w') as cfgfile: + cfgfile.write(config) + + with open('/etc/dovecot/test.passwd','w') as f: + f.write('%s:{plain}%s\n' % (user.login, user.password)) + + # restart will fail if dovecot is not already running + subprocess.call(['service', 'dovecot', 'stop'], stdout=subprocess.PIPE) + # systemd rate limit will kill it without a bit of sleep (max 5 in 10 sec) + time.sleep(3) + subprocess.check_call(['service', 'dovecot', 'start'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + self.running = True + + # create test mailbox with one new and one old mail + self.mailbox = '/var/mail/' + user.login + self.orig_mbox = \ +'''From test1@test1.com Fri Nov 17 02:21:08 2006 +Date: Thu, 16 Nov 2006 17:12:23 -0800 +From: Test User 1 <test1@test1.com> +To: Dovecot tester <dovecot@test.com> +Subject: Test 1 +Status: N + +Some really important news. + +From test2@test1.com Tue Nov 28 11:29:34 2006 +Date: Tue, 28 Nov 2006 11:29:34 +0100 +From: Test User 2 <test2@test2.com> +To: Dovecot tester <dovecot@test.com> +Subject: Test 2 +Status: R + +More news. + +Get cracking! +''' + with open(self.mailbox, 'w') as f: + f.write(self.orig_mbox) + os.chown(self.mailbox, user.uid, grp.getgrnam('mail')[2]) + os.chmod(self.mailbox, 0o660) + + def __del__(self): + if self.running: + self.close() + + def close(self): + assert self.running + + # restore original configuration and restart dovecot + os.rename('/etc/dovecot/dovecot.conf.autotest', '/etc/dovecot/dovecot.conf') + # quiesce, default configuration has no protocols + subprocess.call(['service', 'dovecot', 'restart'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + + if self.created_inetdconf: + os.unlink('/etc/inetd.conf') + + self.running = False + + def get_ssl_fingerprint(self): + pem = '/etc/ssl/certs/dovecot.pem' + if not os.path.exists(pem): + pem = '/etc/ssl/certs/ssl-cert-snakeoil.pem' + + sp = subprocess.Popen(['openssl','x509','-in',pem,'-noout','-md5','-fingerprint'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) + return sp.communicate(None)[0].split('=',1)[1].strip() +
  4. Download patch debian/tests/general
  5. Download patch debian/tests/control

    --- 1:2.2.25-1/debian/tests/control 2016-07-05 02:46:50.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/tests/control 2016-11-08 13:37:25.000000000 +0000 @@ -4,3 +4,9 @@ Restrictions: needs-root Tests: systemd Depends: dovecot-core, systemd-sysv + +# the old Ubuntu tests +Tests: general +Restrictions: needs-root +Features: no-build-needed +Depends: python3, dovecot-imapd, dovecot-pop3d, dovecot-managesieved, mail-stack-delivery, init-system-helpers
  6. Download patch debian/rules

    --- 1:2.2.25-1/debian/rules 2016-07-05 02:46:50.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/rules 2016-11-08 13:37:25.000000000 +0000 @@ -9,6 +9,11 @@ export DEB_BUILD_MAINT_OPTIONS=hardening # DRAC doesn't build with -fPIE drac_buildflags = DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" dpkg-buildflags +# LP: 1636781 - strip incompatible default linker option +ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes) + export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions +endif + # Macros to help move files to the module packages CORE_DIR=$(CURDIR)/debian/dovecot-core PKG_DIR=$(CURDIR)/debian/dovecot-PKG @@ -57,8 +62,6 @@ sieve_files = usr/bin/sieve* \ solr_files = usr/lib/dovecot/modules/lib??_fts_solr_* -lucene_files = usr/lib/dovecot/modules/lib??_fts_lucene_* - dev_files = usr/include/* \ usr/lib/dovecot/dovecot-config @@ -77,7 +80,7 @@ override_dh_auto_configure: --with-solr \ --with-ioloop=best \ --with-libwrap \ - --with-lucene \ + --without-lucene \ --with-lz4 \ --prefix=/usr \ --sysconfdir=/etc \ @@ -149,6 +152,9 @@ override_dh_install: install -m644 debian/dovecot-imapd.ufw.profile debian/dovecot-imapd/etc/ufw/applications.d/dovecot-imapd install -m644 debian/dovecot-pop3d.ufw.profile debian/dovecot-pop3d/etc/ufw/applications.d/dovecot-pop3d + mkdir -p $(CURDIR)/debian/mail-stack-delivery/etc/dovecot/conf.d/ + cp $(CURDIR)/debian/99-mail-stack-delivery.conf $(CURDIR)/debian/mail-stack-delivery/etc/dovecot/conf.d/ + override_dh_installpam: dh_installpam -pdovecot-core --name=dovecot
  7. Download patch debian/dovecot-core.maintscript

    --- 1:2.2.25-1/debian/dovecot-core.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/dovecot-core.maintscript 2016-11-08 13:37:25.000000000 +0000 @@ -0,0 +1 @@ +rm_conffile /etc/init/dovecot.conf 1:2.2.22-1ubuntu4
  8. Download patch debian/control

    --- 1:2.2.25-1/debian/control 2016-07-05 02:46:50.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/control 2016-11-08 13:37:25.000000000 +0000 @@ -1,7 +1,8 @@ Source: dovecot Section: mail Priority: optional -Maintainer: Dovecot Maintainers <jaldhar-dovecot@debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Dovecot Maintainers <jaldhar-dovecot@debian.org> Uploaders: Jaldhar H. Vyas <jaldhar@debian.org>, Fabio Tranchitella <kobold@debian.org>, Joel Johnson <mrjoel@lixil.net>, Marco Nenciarini <mnencia@debian.org>, Jelmer Vernooij <jelmer@debian.org>, Apollon Oikonomopoulos <apoikos@debian.org> Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1), @@ -23,11 +24,9 @@ Build-Depends: debhelper (>= 9), libwrap0-dev, dh-systemd, lsb-release, - libclucene-dev (>= 2.3), liblzma-dev, liblz4-dev, libexttextcat-dev, - libstemmer-dev, autotools-dev, dh-exec Standards-Version: 3.9.8 @@ -37,11 +36,13 @@ Vcs-Browser: https://anonscm.debian.org/ Package: dovecot-core Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 0.76-13.1), openssl, adduser, ucf (>= 2.0020), lsb-base -Suggests: ntp, dovecot-gssapi, dovecot-sieve, dovecot-pgsql, dovecot-mysql, dovecot-sqlite, dovecot-ldap, dovecot-imapd, dovecot-pop3d, dovecot-lmtpd, dovecot-managesieved, dovecot-solr, dovecot-lucene +Depends: ${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 0.76-13.1), openssl, adduser, ucf (>= 2.0020), lsb-base, ssl-cert +Suggests: ntp, dovecot-gssapi, dovecot-sieve, dovecot-pgsql, dovecot-mysql, dovecot-sqlite, dovecot-ldap, dovecot-imapd, dovecot-pop3d, dovecot-lmtpd, dovecot-managesieved, dovecot-solr Provides: dovecot-common, dovecot-abi-${dovecot:ABI-Version} -Replaces: dovecot-common (<< 1:2.0.14-2~), mailavenger (<< 0.8.1-4) -Breaks: dovecot-common (<< 1:2.0.14-2~), mailavenger (<< 0.8.1-4) +Replaces: dovecot-common (<< 1:2.0.14-2~), mailavenger (<< 0.8.1-4), + dovecot-lucene (<<1:2.2.24~) +Breaks: dovecot-common (<< 1:2.0.14-2~), mailavenger (<< 0.8.1-4), + dovecot-lucene (<<1:2.2.24~) Description: secure POP3/IMAP server - core files Dovecot is a mail server whose major goals are security and extreme reliability. It tries very hard to handle all error conditions and verify @@ -208,18 +209,6 @@ Description: secure POP3/IMAP server - S . This package provides Solr full text search support for Dovecot. -Package: dovecot-lucene -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, dovecot-core (= ${binary:Version}) -Description: secure POP3/IMAP server - Lucene support - Dovecot is a mail server whose major goals are security and extreme - reliability. It tries very hard to handle all error conditions and verify - that all data is valid, making it nearly impossible to crash. It supports - mbox/Maildir and its own dbox/mdbox formats, and should also be pretty - fast, extensible, and portable. - . - This package provides Lucene full text search support for Dovecot. - Package: dovecot-dbg Section: debug Priority: extra @@ -233,3 +222,18 @@ Description: secure POP3/IMAP server - d fast, extensible, and portable. . This package contains debug symbols for Dovecot. + +Package: mail-stack-delivery +Architecture: all +Depends: dovecot-core, dovecot-imapd, dovecot-pop3d, dovecot-managesieved, + postfix, ${misc:Depends} +Replaces: dovecot-postfix (<< 1:1.2.12-0ubuntu1~) +Description: mail server delivery agent stack provided by Ubuntu server team + Ubuntu's mail stack provides fully operational delivery with + safe defaults and additional options. Out of the box it supports IMAP, + POP3 and SMTP services with SASL authentication and Maildir as default + storage engine. + . + This package contains configuration files for dovecot. + . + This package modifies postfix's configuration to integrate with dovecot
  9. Download patch debian/mail-stack-delivery.dirs

    --- 1:2.2.25-1/debian/mail-stack-delivery.dirs 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/mail-stack-delivery.dirs 2016-11-08 13:37:25.000000000 +0000 @@ -0,0 +1,2 @@ +var/backups +var/backups/mail-stack-delivery
  10. Download patch debian/99-mail-stack-delivery.conf

    --- 1:2.2.25-1/debian/99-mail-stack-delivery.conf 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/99-mail-stack-delivery.conf 2016-11-08 13:37:25.000000000 +0000 @@ -0,0 +1,48 @@ +# Some general options +protocols = imap pop3 sieve +disable_plaintext_auth = yes +ssl = yes +ssl_cert = </etc/dovecot/dovecot.pem +ssl_key = </etc/dovecot/private/dovecot.pem +ssl_cipher_list = ALL:!LOW:!SSLv2:ALL:!aNULL:!ADH:!eNULL:!EXP:RC4+RSA:+HIGH:+MEDIUM +mail_location = maildir:~/Maildir +auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@ + +# IMAP configuration +protocol imap { + mail_max_userip_connections = 10 + imap_client_workarounds = delay-newmail +} + +# POP3 configuration +protocol pop3 { + mail_max_userip_connections = 10 + pop3_client_workarounds = outlook-no-nuls oe-ns-eoh +} + +# LDA configuration +protocol lda { + postmaster_address = postmaster + mail_plugins = sieve + quota_full_tempfail = yes + deliver_log_format = msgid=%m: %$ + rejection_reason = Your message to <%t> was automatically rejected:%n%r +} + +# Plugins configuration +plugin { + sieve=~/.dovecot.sieve + sieve_dir=~/sieve +} + +# Authentication configuration +auth_mechanisms = plain login + +service auth { + # Postfix smtp-auth + unix_listener /var/spool/postfix/private/dovecot-auth { + mode = 0660 + user = postfix + group = postfix + } +}
  11. Download patch debian/dovecot-core.dirs

    --- 1:2.2.25-1/debian/dovecot-core.dirs 2016-07-05 02:46:50.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/dovecot-core.dirs 2016-11-08 13:37:25.000000000 +0000 @@ -1,5 +1,6 @@ etc/dovecot/conf.d etc/dovecot/private +etc/ssl/certs usr/sbin usr/share/dovecot/protocols.d var/lib/dovecot
  12. Download patch debian/mail-stack-delivery.preinst

    --- 1:2.2.25-1/debian/mail-stack-delivery.preinst 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/mail-stack-delivery.preinst 2016-11-08 13:37:25.000000000 +0000 @@ -0,0 +1,56 @@ +#!/bin/sh + +set -e + +# Prepare to move a conffile without triggering a dpkg question +prep_mv_conffile() { + PKGNAME="$1" + CONFFILE="$2" + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" + if [ "$md5sum" = "$old_md5sum" ]; then + rm -f "$CONFFILE" + else + if [ -e "$CONFFILE" ]; then + if [ "$CONFFILE" = "/etc/dovecot/conf.d/01-dovecot-postfix.conf" ]; then + mv -f "$CONFFILE" "/etc/dovecot/conf.d/01-mail-stack-delivery.conf" + fi + if [ "$CONFFILE" = "/etc/dovecot/auth.d/01-dovecot-postfix.auth" ]; then + mv -f "$CONFFILE" "/etc/dovecot/auth.d/01-mail-stack-delivery.auth" + fi + fi + fi + fi +} +case "$1" in +install|upgrade) + # Check if mail-stack-delivery.conf had any customizations + if [ -f "/usr/share/dovecot/mail-stack-delivery.conf" ]; then + if [ -f "/etc/dovecot/mail-stack-delivery.conf" ]; then + mv /etc/dovecot/mail-stack-delivery.conf /etc/dovecot/mail-stack-delivery.conf.bak + DIR=`mktemp -d` + egrep -v ^protocol /etc/dovecot/mail-stack-delivery.conf.bak > $DIR/mail-stack-delivery-custom.conf + egrep -v ^protocol /usr/share/dovecot/mail-stack-delivery.conf > $DIR/mail-stack-delivery.conf + if diff -qur $DIR/mail-stack-delivery-dist.conf $DIR/mail-stack-delivery-custom.conf 1>/dev/null 2>&1; then + rm -f /etc/dovecot/mail-stack-delivery.conf.bak + else + awk ' /^auth default/ {flag=1;next} /^}/{flag=0} flag { print }' /etc/dovecot/mail-stack-delivery.conf.bak > /etc/dovecot/auth.d/01-mail-stack-delivery.auth + awk ' /^## Dovecot conf/{flag=1} /^auth default/{flag=0} flag { print }' /etc/dovecot/mail-stack-delivery.conf.bak > /etc/dovecot/conf.d/01-mail-stack-delivery.conf + awk ' /^# If you wish to use another authentication server than dovecot-auth/{flag=1} flag { print }' /etc/dovecot/mail-stack-delivery.conf.bak >> /etc/dovecot/conf.d/01-mail-stack-delivery.conf + fi + rm -rf $DIR + fi + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER#
  13. Download patch debian/tests/testlib.py

    --- 1:2.2.25-1/debian/tests/testlib.py 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/tests/testlib.py 2016-11-08 13:37:25.000000000 +0000 @@ -0,0 +1,89 @@ +'''Common classes and functions for package tests.''' + +import string, random, crypt, subprocess, pwd, signal, time + +class TimedOutException(Exception): + def __init__(self, value = "Timed Out"): + self.value = value + def __str__(self): + return repr(self.value) + +def timeout(secs, f, *args): + def handler(signum, frame): + raise TimedOutException() + + old = signal.signal(signal.SIGALRM, handler) + result = None + signal.alarm(secs) + try: + result = f(*args) + finally: + signal.alarm(0) + signal.signal(signal.SIGALRM, old) + + return result + +def random_string(length): + '''Return a random string, consisting of ASCII letters, with given + length.''' + + s = '' + maxind = len(string.ascii_letters)-1 + for l in range(length): + s += string.ascii_letters[random.randint(0, maxind)] + return s.lower() + +def login_exists(login): + '''Checks whether the given login exists on the system.''' + + try: + pwd.getpwnam(login) + return True + except KeyError: + return False + +class TestUser: + '''Create a temporary test user and remove it again on close.''' + + def __init__(self, login=None, home=True): + '''Create a new user account with a random password. + + By default, the login name is random, too, but can be explicitly + specified with 'login'. By default, a home directory is created, this + can be suppressed with 'home=False'.''' + + self.login = None + + if login: + if login_exists(login): + raise ValueError('login name already exists') + else: + while(True): + login = random_string(8) + if not login_exists(login): + break + + self.salt = random_string(2) + self.password = random_string(8) + self.crypted = crypt.crypt(self.password, self.salt) + + if home: + subprocess.check_call(['useradd', '-p', self.crypted, '-m', login]) + else: + subprocess.check_call(['useradd', '-p', self.crypted, login]) + + self.login = login + p = pwd.getpwnam(self.login) + self.uid = p[2] + self.gid = p[3] + + def __del__(self): + '''Remove the created user account.''' + + if self.login: + self.close() + + def close(self): + '''Remove the created user account.''' + subprocess.check_call(['userdel', '-r', self.login]) + self.login = None
  14. Download patch debian/mail-stack-delivery.postrm

    --- 1:2.2.25-1/debian/mail-stack-delivery.postrm 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.2.25-1ubuntu2/debian/mail-stack-delivery.postrm 2016-11-08 13:37:25.000000000 +0000 @@ -0,0 +1,35 @@ +#!/bin/sh +set -e + +POSTFIX_BCKFILE="/var/backups/mail-stack-delivery/main.cf-backup" + +PATH=/usr/sbin:$PATH +export PATH + +if [ "$1" = "remove" -o "$1" = "purge" ]; then + # Restore postfix configuration + if [ "$1" = "remove" ]; then + if which postconf >/dev/null && [ -f "${POSTFIX_BCKFILE}" ]; then + while read line; do + postconf -e "$line" + done < "${POSTFIX_BCKFILE}" + rm -f "${POSTFIX_BCKFILE}" + fi + fi + if [ -x "/etc/init.d/dovecot" ]; then + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d dovecot restart + else + service dovecot restart + fi + fi + if [ -x "/etc/init.d/postfix" ]; then + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d postfix restart + else + service postfix restart + fi + fi +fi + +#DEBHELPER#
  1. dovecot