aboutsummaryrefslogtreecommitdiff
path: root/mail/dovecot
diff options
context:
space:
mode:
authorBeech Rintoul <beech@FreeBSD.org>2008-12-13 06:56:31 +0000
committerBeech Rintoul <beech@FreeBSD.org>2008-12-13 06:56:31 +0000
commit0e67aa3dca399c55734f0f3af36d0d763fed54ad (patch)
tree510ce1f2f6c08d4fd972e3f2f1bb0654f62eb726 /mail/dovecot
parente99a993ccec657bc6167e1f03b4e7f8078f1ad41 (diff)
downloadports-0e67aa3dca399c55734f0f3af36d0d763fed54ad.tar.gz
ports-0e67aa3dca399c55734f0f3af36d0d763fed54ad.zip
- Patch to facilitate multi-instance configurations
PR: ports/129274 Submitted by: Darren Pilgrim <phi@evilphi.com> Approved by: Yarema <yds@coolrat.org> (maintainer)
Notes
Notes: svn path=/head/; revision=224178
Diffstat (limited to 'mail/dovecot')
-rw-r--r--mail/dovecot/Makefile1
-rw-r--r--mail/dovecot/files/dovecot.sh.in37
-rw-r--r--mail/dovecot/files/pkg-message.in17
3 files changed, 37 insertions, 18 deletions
diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile
index b27d95740097..52e45f7cf3db 100644
--- a/mail/dovecot/Makefile
+++ b/mail/dovecot/Makefile
@@ -7,6 +7,7 @@
PORTNAME= dovecot
PORTVERSION= 1.1.7
+PORTREVISION= 1
CATEGORIES= mail ipv6
MASTER_SITES= http://www.dovecot.org/releases/1.1/
diff --git a/mail/dovecot/files/dovecot.sh.in b/mail/dovecot/files/dovecot.sh.in
index edf7033e0ab0..176d647c657b 100644
--- a/mail/dovecot/files/dovecot.sh.in
+++ b/mail/dovecot/files/dovecot.sh.in
@@ -20,31 +20,40 @@ rcvar=`set_rcvar`
# read configuration and set defaults
load_rc_config ${name}
: ${dovecot_enable:="NO"}
+: ${dovecot_config:="%%PREFIX%%/etc/${name}.conf"}
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"
-
-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"
+restart_cmd="restart_cmd"
start_precmd()
{ # Ensure runtime directories exist with correct permissions
- local gid
- gid=$(/usr/sbin/pw usershow -n "${login_user}" 2>/dev/null | /usr/bin/cut -d: -f4)
+ local login_user login_gid
+ login_user=$(${command} ${command_args} -a | /usr/bin/awk -F ': ' '/^login_user:/ { print $2 }')
+ login_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}
+ /usr/bin/install -o root -g ${login_gid} -m 0750 -d ${login_dir}
}
stop_postcmd()
{ # Cleanup runtime directories
- rm -rf ${base_dir} 2>/dev/null
+ rm -rf ${login_dir} ${base_dir} 2>/dev/null
+}
+
+restart_cmd()
+{ # Overriding makes rc.subr run this once for each instance
+ run_rc_command stop
+ run_rc_command start
}
-run_rc_command "$1"
+# To start multiple instances of dovecot set dovecot_config to
+# a space seperated list of configuration files.
+for config in ${dovecot_config}; do
+ required_files="${config}"
+ command_args="-c ${config}"
+ 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 }')
+ pidfile="${base_dir}/master.pid"
+ run_rc_command "$1"
+done
diff --git a/mail/dovecot/files/pkg-message.in b/mail/dovecot/files/pkg-message.in
index a86b76ee9d4f..139698a5357f 100644
--- a/mail/dovecot/files/pkg-message.in
+++ b/mail/dovecot/files/pkg-message.in
@@ -1,12 +1,21 @@
---------------------------------------------------------------------
You can get basic IMAP and POP3 services running by enabling
- dovecot in /etc/rc.conf.
+ dovecot in the /etc/rc.conf file.
- In this basic configuration Dovecot will authenticate users against
+ dovecot_enable
+ (bool) If set to ``YES'', run the dovecot command
+ at boot time.
+
+ In the basic configuration Dovecot will authenticate users against
the system's passwd file and use the default /var/mail/$USER mbox
files.
- echo dovecot_enable="YES" >> /etc/rc.conf
-
+ dovecot_config
+ (str) Path to dovecot configuration file(s).
+ Default %%PREFIX%%/etc/dovecot.conf.
+
+ To start multiple instances of dovecot set dovecot_config to
+ a space seperated list of configuration files.
+
---------------------------------------------------------------------