Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Nov 2008 07:38:41 -0500 (EST)
From:      Yarema <yds@CoolRat.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Wesley Shields <wxs@FreeBSD.org>, Xin LI <delphij@FreeBSD.org>, Desvernay Geoffroy <dgeo@ec-marseille.fr>
Subject:   ports/129230: [PATCH] Update mail/dovecot to latest 1.1.7
Message-ID:  <20081127123841.89EBA6432C3D@orion.dppl.com>
Resent-Message-ID: <200811271250.mARCo1LB068488@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         129230
>Category:       ports
>Synopsis:       [PATCH] Update mail/dovecot to latest 1.1.7
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 27 12:50:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Yarema
>Release:        FreeBSD 6.4-PRERELEASE amd64
>Organization:
NYCBUG.org
>Environment:

	FreeBSD 6.4-PRERELEASE amd64
	FreeBSD 7.1-PRERELEASE amd64
>Description:
Supersedes PRs: ports/129202; ports/129106; ports/129153; ports/129155

Version update to dovecot-1.1.7 and dovecot-1.1.7-managesieve-0.10.4

'statedir' set to /var/db/dovecot instead of defaulting to /var/lib/dovecot
Users should manually rm -rf /var/lib/dovecot

Removed stale code from files/pkg-deinstall.in and files/pkg-install.in

Reworked files/dovecot.sh.in to accept dovecot_config and handle creating
and tearing down runtime directories upon startup and shutdown.

Rediffed files/patch-dovecot-example.conf to clean up line offsets.

>How-To-Repeat:
	cd /usr/ports/mail/dovecot && make install
>Fix:
diff -u -r -N dovecot-1.1.6_1/Makefile dovecot/Makefile
--- dovecot-1.1.6_1/Makefile	2008-11-16 04:09:29.000000000 -0500
+++ dovecot/Makefile	2008-11-27 02:54:32.000000000 -0500
@@ -6,8 +6,7 @@
 #
 
 PORTNAME=	dovecot
-PORTVERSION=	1.1.6
-PORTREVISION=	1
+PORTVERSION=	1.1.7
 CATEGORIES=	mail ipv6
 MASTER_SITES=	http://www.dovecot.org/releases/1.1/
 
@@ -19,7 +18,9 @@
 
 GNU_CONFIGURE=	yes
 CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
-CONFIGURE_ARGS=		--localstatedir=/var --without-shadow
+CONFIGURE_ARGS=		--localstatedir=/var \
+			--with-statedir=/var/db/dovecot \
+			--without-shadow
 CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
 		LDFLAGS="-L${LOCALBASE}/lib"
 USE_LDCONFIG=	${PREFIX}/lib/dovecot \
diff -u -r -N dovecot-1.1.6_1/distinfo dovecot/distinfo
--- dovecot-1.1.6_1/distinfo	2008-11-16 04:09:29.000000000 -0500
+++ dovecot/distinfo	2008-11-27 02:14:07.000000000 -0500
@@ -1,6 +1,6 @@
-MD5 (dovecot-1.1.6.tar.gz) = ccbfcfcb5e6d19a3228885a2f7eae2dd
-SHA256 (dovecot-1.1.6.tar.gz) = 91ab9b78e2ed4230d96faa89aecde3e6c42ad7e2ef4858c292c5988b195cbbec
-SIZE (dovecot-1.1.6.tar.gz) = 2320875
-MD5 (dovecot-1.1.6-managesieve-0.10.3.diff.gz) = 0450151b4515afb036b4c94ac9e912fc
-SHA256 (dovecot-1.1.6-managesieve-0.10.3.diff.gz) = 4a9612f788796d1c18653bc0aa5cc9269b3365d4a0358b3f6bf05cda206c139f
-SIZE (dovecot-1.1.6-managesieve-0.10.3.diff.gz) = 5912
+MD5 (dovecot-1.1.7.tar.gz) = ea83ea2000a5b2e1744c7c97eb5585d1
+SHA256 (dovecot-1.1.7.tar.gz) = 915cae7684438c6335d0472ff20ec2fe44d620aa61f404ce91fd02a27434cf9f
+SIZE (dovecot-1.1.7.tar.gz) = 2325617
+MD5 (dovecot-1.1.7-managesieve-0.10.4.diff.gz) = 57a751fb10ac3fcb700d5cc434546be2
+SHA256 (dovecot-1.1.7-managesieve-0.10.4.diff.gz) = dc13a3c231c7bd29a452e16f3654c941bfc2a89c31e6b392ac76ca47cd897a76
+SIZE (dovecot-1.1.7-managesieve-0.10.4.diff.gz) = 5912
diff -u -r -N dovecot-1.1.6_1/files/dovecot.sh.in dovecot/files/dovecot.sh.in
--- dovecot-1.1.6_1/files/dovecot.sh.in	2008-11-16 04:09:29.000000000 -0500
+++ dovecot/files/dovecot.sh.in	2008-11-27 06:41:41.479999712 -0500
@@ -7,34 +7,44 @@
 # REQUIRE: %%REQUIRE%%
 # KEYWORD: shutdown
 
-# Define these dovecot_* variables in one of these files:
+# Define dovecot_* variables in one of these files:
 #	/etc/rc.conf
 #	/etc/rc.conf.local
 #	/etc/rc.conf.d/dovecot
-#
-# DO NOT CHANGE THESE DEFAULT VALUES HERE
-#
-: ${dovecot_enable:="NO"}
 
 . %%RC_SUBR%%
 
 name=dovecot
 rcvar=`set_rcvar`
 
-command=%%PREFIX%%/sbin/${name}
-required_files=%%PREFIX%%/etc/${name}.conf
-start_precmd="${name}_prestart"
+# read configuration and set defaults
+load_rc_config ${name}
+: ${dovecot_enable:="NO"}
+
+command="%%PREFIX%%/sbin/${name}"
+command_args="-c ${dovecot_config:="%%PREFIX%%/etc/${name}.conf"}"
+required_files="${dovecot_config}"
+start_precmd="start_precmd"
+stop_postcmd="stop_postcmd"
 extra_commands="restart"
 
-dovecot_prestart()
+base_dir=$(${command} ${command_args} -a | /usr/bin/awk -F ': ' '/^base_dir:/ { print $2 }')
+login_dir=$(${command} ${command_args} -a | /usr/bin/awk -F ': ' '/^login_dir:/ { print $2 }')
+login_user=$(${command} ${command_args} -a | /usr/bin/awk -F ': ' '/^login_user:/ { print $2 }')
+
+pidfile="${base_dir}/master.pid"
+
+start_precmd()
 {	# Ensure runtime directories exist with correct permissions
-	local base user gid
-	base=/var/run/${name}
-	user=$(/usr/bin/awk -F '[[:space:]]*=[[:space:]]*' '/^[[:space:]]*login_user[[:space:]]*=/ { print $2 }' ${required_files})
-	gid=$(/usr/sbin/pw usershow -n "${user:-${name}}" 2>/dev/null | /usr/bin/cut -d: -f4)
-	/usr/bin/install -o root -g wheel -m 0755 -d ${base}
-	/usr/bin/install -o root -g ${gid} -m 0750 -d ${base}/login
+	local gid
+	gid=$(/usr/sbin/pw usershow -n "${login_user}" 2>/dev/null | /usr/bin/cut -d: -f4)
+	/usr/bin/install -o root -g wheel -m 0755 -d ${base_dir}
+	/usr/bin/install -o root -g ${gid} -m 0750 -d ${login_dir}
+}
+
+stop_postcmd()
+{	# Cleanup runtime directories
+	rm -rf ${base_dir} 2>/dev/null
 }
 
-load_rc_config ${name}
 run_rc_command "$1"
diff -u -r -N dovecot-1.1.6_1/files/patch-dovecot-example.conf dovecot/files/patch-dovecot-example.conf
--- dovecot-1.1.6_1/files/patch-dovecot-example.conf	2008-11-16 04:09:31.000000000 -0500
+++ dovecot/files/patch-dovecot-example.conf	2008-11-23 16:53:53.000000000 -0500
@@ -1,5 +1,5 @@
---- dovecot-example.conf.orig	2008-10-26 11:00:45.000000000 -0400
-+++ dovecot-example.conf	2008-10-26 11:00:45.000000000 -0400
+--- dovecot-example.conf.orig	2008-11-23 16:53:53.000000000 -0500
++++ dovecot-example.conf	2008-11-23 16:53:53.000000000 -0500
 @@ -20,7 +20,7 @@
  
  # Protocols we want to be serving: imap imaps pop3 pop3s
@@ -18,7 +18,7 @@
  
  # Should all IMAP and POP3 processes be killed when Dovecot master process
  # shuts down. Setting this to "no" means that Dovecot can be upgraded without
-@@ -211,7 +211,7 @@
+@@ -213,7 +213,7 @@
  #
  # <doc/wiki/MailLocation.txt>
  #
@@ -27,7 +27,7 @@
  
  # If you need to set multiple mailbox locations or want to change default
  # namespace settings, you can do it by defining namespace sections.
-@@ -271,7 +271,7 @@
+@@ -273,7 +273,7 @@
  # Group to enable temporarily for privileged operations. Currently this is
  # used only with INBOX when either its initial creation or dotlocking fails.
  # Typically this is set to "mail" to give access to /var/mail.
@@ -36,7 +36,7 @@
  
  # Grant access to these supplementary groups for mail processes. Typically
  # these are used to set up access to shared mailboxes. Note that it may be
-@@ -310,7 +310,7 @@
+@@ -312,7 +312,7 @@
  
  # Rely on O_EXCL to work when creating dotlock files. NFS supports O_EXCL
  # since version 3, so this should be safe to use nowadays by default.
@@ -45,7 +45,7 @@
  
  # Don't use fsync() or fdatasync() calls. This makes the performance better
  # at the cost of potential data loss if the server (or the file server)
-@@ -338,20 +338,20 @@
+@@ -340,20 +340,20 @@
  # Show more verbose process titles (in ps). Currently shows user name and
  # IP address. Useful for seeing who are actually using the IMAP processes
  # (eg. shared mailboxes or if same uid is used for multiple accounts).
@@ -69,7 +69,7 @@
  #last_valid_gid = 0
  
  # Maximum number of running mail processes. When this limit is reached,
-@@ -418,7 +418,7 @@
+@@ -420,7 +420,7 @@
  
  # When copying a message, do it with hard links whenever possible. This makes
  # the performance much better, and it's unlikely to have any side effects.
@@ -78,7 +78,7 @@
  
  # When copying a message, try to preserve the base filename. Only if the
  # destination mailbox already contains the same name (ie. the mail is being
-@@ -533,7 +533,7 @@
+@@ -535,7 +535,7 @@
    # Send IMAP capabilities in greeting message. This makes it unnecessary for
    # clients to request it with CAPABILITY command, so it saves one round-trip.
    # Many clients however don't understand it and ask the CAPABILITY anyway.
@@ -87,7 +87,7 @@
  
    # IMAP logout format string:
    #  %i - total number of bytes read from client
-@@ -562,7 +562,7 @@
+@@ -564,7 +564,7 @@
    #     but not both. Thunderbird separates these two by forcing server to
    #     accept '/' suffix in mailbox names in subscriptions list.
    # The list is space-separated.
@@ -96,7 +96,7 @@
  }
    
  ##
-@@ -614,7 +614,7 @@
+@@ -616,7 +616,7 @@
    # Dovecot's default, so if you're building a new server it would be a good
    # idea to change this. %08Xu%08Xv should be pretty fail-safe.
    #
@@ -105,7 +105,7 @@
  
    # POP3 logout format string:
    #  %i - total number of bytes read from client
-@@ -645,7 +645,7 @@
+@@ -647,7 +647,7 @@
    #     Outlook Express and Netscape Mail breaks if end of headers-line is
    #     missing. This option simply sends it if it's missing.
    # The list is space-separated.
@@ -114,7 +114,7 @@
  }
  
  ##
-@@ -736,7 +736,7 @@
+@@ -738,7 +738,7 @@
  # the standard variables here, eg. %Lu would lowercase the username, %n would
  # drop away the domain if it was given, or "%n-AT-%d" would change the '@' into
  # "-AT-". This translation is done after auth_username_translation changes.
@@ -123,7 +123,7 @@
  
  # If you want to allow master users to log in by specifying the master
  # username within the normal username string (ie. not using SASL mechanism's
-@@ -792,7 +792,7 @@
+@@ -794,7 +794,7 @@
    #   plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey
    #   gss-spnego
    # NOTE: See also disable_plaintext_auth setting.
@@ -132,7 +132,7 @@
  
    #
    # Password database is used to verify user's password (and nothing more).
-@@ -854,6 +854,7 @@
+@@ -856,6 +856,7 @@
      #   args = session=yes %Ls
      #   args = cache_key=%u dovecot
      #args = dovecot
@@ -140,7 +140,7 @@
    }
  
    # System users (NSS, /etc/passwd, or similiar)
-@@ -897,14 +898,16 @@
+@@ -899,14 +900,16 @@
  
    # SQL database <doc/wiki/AuthDatabase.SQL.txt>
    #passdb sql {
@@ -161,7 +161,7 @@
    #}
  
    # vpopmail authentication <doc/wiki/AuthDatabase.VPopMail.txt>
-@@ -931,7 +934,7 @@
+@@ -933,7 +936,7 @@
      # proceses. Useful with remote NSS lookups that may block.
      # NOTE: Be sure to use this setting with nss_ldap or users might get
      # logged in as each others!
@@ -170,7 +170,7 @@
    }
  
    # passwd-like file with specified location
-@@ -960,14 +963,16 @@
+@@ -962,14 +965,16 @@
  
    # SQL database <doc/wiki/AuthDatabase.SQL.txt>
    #userdb sql {
@@ -191,7 +191,7 @@
    #}
  
    # vpopmail <doc/wiki/AuthDatabase.VPopMail.txt>
-@@ -1007,25 +1012,25 @@
+@@ -1009,25 +1014,25 @@
    #ssl_username_from_cert = no
  
    # It's possible to export the authentication interface to other programs:
@@ -227,7 +227,7 @@
  }
  
  # If you wish to use another authentication server than dovecot-auth, you can
-@@ -1055,8 +1060,9 @@
+@@ -1057,8 +1062,9 @@
    #quota = mysql:/etc/dovecot-dict-quota.conf 
  }
  
@@ -239,7 +239,7 @@
  
  ##
  ## Plugin settings
-@@ -1093,8 +1099,8 @@
+@@ -1095,8 +1101,8 @@
    # Each quota root has separate limits. Only the command for the first
    # exceeded limit is excecuted, so put the highest limit first.
    # Note that % needs to be escaped as %%, otherwise "% " expands to empty.
@@ -250,7 +250,7 @@
    #quota = maildir
  
    # ACL plugin. vfile backend reads ACLs from "dovecot-acl" file from maildir
-@@ -1131,7 +1137,7 @@
+@@ -1133,7 +1139,7 @@
    # you must set up:
    #   dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool
    #expire = Trash 7 Spam 30
diff -u -r -N dovecot-1.1.6_1/files/pkg-deinstall.in dovecot/files/pkg-deinstall.in
--- dovecot-1.1.6_1/files/pkg-deinstall.in	2008-09-08 02:42:28.000000000 -0400
+++ dovecot/files/pkg-deinstall.in	2008-11-27 05:35:46.155267036 -0500
@@ -2,7 +2,8 @@
 #
 #	$FreeBSD: ports/mail/dovecot/files/pkg-deinstall.in,v 1.1 2008/09/08 06:42:28 beech Exp $
 #
-# ex:ts=4
+
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
 
 ask() {
 	local question default answer
@@ -48,7 +49,7 @@
 DEINSTALL)
 	if ps -axc | grep -qw dovecot; then
 		if yesno "Dovecot is still running. Shall I stop it?" y; then
-			killall dovecot
+			${PKG_PREFIX}/etc/rc.d/dovecot stop
 			sleep 2
 		else
 			echo "OK ... I hope you know what you are doing."
@@ -57,14 +58,7 @@
 
 	delete_account Dovecot dovecot:${DOVECOT_UID:-%%DOVECOT_UID%%} dovecot:${DOVECOT_GID:-%%DOVECOT_GID%%}
 
-	echo "Also manually rm -rf /var/db/dovecot if anything was stored there."
-
-	base=/var/run/dovecot
-	DIRLIST="${base}/login ${base}"
-	echo "Cleaning up \"${base}\"."
-	for directory in ${DIRLIST}; do
-		rmdir ${directory} 2>/dev/null || :
-	done
+	echo "Also manually 'rm -rf /var/db/dovecot' if anything was stored there."
 	;;
 
 esac
diff -u -r -N dovecot-1.1.6_1/files/pkg-install.in dovecot/files/pkg-install.in
--- dovecot-1.1.6_1/files/pkg-install.in	2008-09-08 02:42:28.000000000 -0400
+++ dovecot/files/pkg-install.in	2008-11-27 05:35:47.498576687 -0500
@@ -2,7 +2,8 @@
 #
 #	$FreeBSD: ports/mail/dovecot/files/pkg-install.in,v 1.1 2008/09/08 06:42:28 beech Exp $
 #
-# ex:ts=4
+
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
 
 ask() {
 	local question default answer
@@ -88,10 +89,4 @@
 	create_account Dovecot dovecot:${DOVECOT_UID:-%%DOVECOT_UID%%} dovecot:${DOVECOT_GID:-%%DOVECOT_GID%%} "Dovecot User" /var/empty /usr/sbin/nologin
 	;;
 
-POST-INSTALL)
-	base=/var/run/dovecot
-	/usr/bin/install -o root -g wheel -m 0755 -d ${base}
-	/usr/bin/install -o root -g dovecot -m 0750 -d ${base}/login
-	;;
-
 esac
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081127123841.89EBA6432C3D>