summaryrefslogtreecommitdiff
path: root/net-mail/dovecot/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-mail/dovecot/files')
-rw-r--r--net-mail/dovecot/files/dovecot-1.2.init61
-rw-r--r--net-mail/dovecot/files/dovecot-2.0.12-sdbox.patch17
-rw-r--r--net-mail/dovecot/files/dovecot.init-r258
-rw-r--r--net-mail/dovecot/files/pigeonhole-fix-vacation-handle.patch140
4 files changed, 276 insertions, 0 deletions
diff --git a/net-mail/dovecot/files/dovecot-1.2.init b/net-mail/dovecot/files/dovecot-1.2.init
new file mode 100644
index 0000000..b9dd672
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-1.2.init
@@ -0,0 +1,61 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/files/dovecot-1.2.init,v 1.2 2011/08/05 07:05:46 eras Exp $
+
+opts="${opts} reload"
+
+depend() {
+ need localmount net
+ before postfix
+ after bootmisc ldap mysql ntp-client ntpd postgresql saslauthd slapd
+ use logger
+}
+
+checkconfig() {
+ DOVECOT_INSTANCE=${SVCNAME##*.}
+ if [ -n "${DOVECOT_INSTANCE}" -a "${SVCNAME}" != "dovecot" ]; then
+ DOVECOT_CONF=/etc/dovecot/dovecot.${DOVECOT_INSTANCE}.conf
+ else
+ DOVECOT_CONF=/etc/dovecot/dovecot.conf
+ fi
+ if [ ! -e ${DOVECOT_CONF} ]; then
+ eerror "You will need an ${DOVECOT_CONF} first"
+ return 1
+ fi
+ if [ -x /usr/sbin/dovecot ]; then
+ DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} -a | grep '^base_dir: ' | sed 's/^base_dir: //')
+ else
+ eerror "dovecot not executable"
+ return 1
+ fi
+ DOVECOT_BASEDIR=${DOVECOT_BASEDIR:-/var/run/dovecot}
+ DOVECOT_PIDFILE=${DOVECOT_BASEDIR}/master.pid
+ if [ ! -d "${DOVECOT_BASEDIR}" ]; then
+ install -d -o root -g root -m 0755 "${DOVECOT_BASEDIR}"
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/dovecot \
+ --pidfile "${DOVECOT_PIDFILE}" -- -c "${DOVECOT_CONF}"
+ eend $?
+}
+
+stop() {
+ checkconfig || return 1
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec /usr/sbin/dovecot \
+ --pidfile "${DOVECOT_PIDFILE}"
+ eend $?
+}
+
+reload() {
+ checkconfig || return 1
+ ebegin "Reloading ${SVCNAME} configs and restarting auth/login processes"
+ start-stop-daemon --signal HUP --exec /usr/sbin/dovecot \
+ --pidfile "${DOVECOT_PIDFILE}"
+ eend $?
+}
diff --git a/net-mail/dovecot/files/dovecot-2.0.12-sdbox.patch b/net-mail/dovecot/files/dovecot-2.0.12-sdbox.patch
new file mode 100644
index 0000000..ad16cf3
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-2.0.12-sdbox.patch
@@ -0,0 +1,17 @@
+
+diff -r d4945c93c33b -r 663528c5c799 src/lib-storage/index/dbox-single/sdbox-storage.c
+--- a/src/lib-storage/index/dbox-single/sdbox-storage.c Tue Apr 12 18:38:50 2011 +0300
++++ b/src/lib-storage/index/dbox-single/sdbox-storage.c Sat Apr 30 15:55:08 2011 +0300
+@@ -118,6 +118,8 @@
+ mail_index_update_header_ext(trans, mbox->hdr_ext_id, 0,
+ &new_hdr, sizeof(new_hdr));
+ }
++ memcpy(mbox->mailbox_guid, new_hdr.mailbox_guid,
++ sizeof(mbox->mailbox_guid));
+ }
+
+ static int sdbox_mailbox_create_indexes(struct mailbox *box,
+
+
+
+
diff --git a/net-mail/dovecot/files/dovecot.init-r2 b/net-mail/dovecot/files/dovecot.init-r2
new file mode 100644
index 0000000..21447fe
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot.init-r2
@@ -0,0 +1,58 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/files/dovecot.init-r2,v 1.4 2011/08/05 07:05:46 eras Exp $
+
+opts="${opts} reload"
+
+depend() {
+ need localmount net
+ before postfix
+ after bootmisc ldap mysql ntp-client ntpd postgresql saslauthd slapd
+ use logger
+}
+
+checkconfig() {
+ DOVECOT_INSTANCE=${SVCNAME##*.}
+ if [ -n "${DOVECOT_INSTANCE}" -a "${SVCNAME}" != "dovecot" ]; then
+ DOVECOT_CONF=/etc/dovecot/dovecot.${DOVECOT_INSTANCE}.conf
+ else
+ DOVECOT_CONF=/etc/dovecot/dovecot.conf
+ fi
+ if [ ! -e ${DOVECOT_CONF} ]; then
+ eerror "You will need an ${DOVECOT_CONF} first"
+ return 1
+ fi
+ if [ -x /usr/sbin/dovecot ]; then
+ DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} -a | grep '^base_dir = ' | sed 's/^base_dir = //')
+ else
+ eerror "dovecot not executable"
+ return 1
+ fi
+ DOVECOT_BASEDIR=${DOVECOT_BASEDIR:-/var/run/dovecot}
+ DOVECOT_PIDFILE=${DOVECOT_BASEDIR}/master.pid
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/dovecot \
+ --pidfile "${DOVECOT_PIDFILE}" -- -c "${DOVECOT_CONF}"
+ eend $?
+}
+
+stop() {
+ checkconfig || return 1
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec /usr/sbin/dovecot \
+ --pidfile "${DOVECOT_PIDFILE}"
+ eend $?
+}
+
+reload() {
+ checkconfig || return 1
+ ebegin "Reloading ${SVCNAME} configs and restarting auth/login processes"
+ start-stop-daemon --signal HUP --exec /usr/sbin/dovecot \
+ --pidfile "${DOVECOT_PIDFILE}"
+ eend $?
+}
diff --git a/net-mail/dovecot/files/pigeonhole-fix-vacation-handle.patch b/net-mail/dovecot/files/pigeonhole-fix-vacation-handle.patch
new file mode 100644
index 0000000..744b67e
--- /dev/null
+++ b/net-mail/dovecot/files/pigeonhole-fix-vacation-handle.patch
@@ -0,0 +1,140 @@
+
+--- a/src/lib-sieve/plugins/vacation/cmd-vacation.c Tue Aug 02 17:50:15 2011 +0200
++++ b/src/lib-sieve/plugins/vacation/cmd-vacation.c Wed Sep 21 00:55:58 2011 +0200
+@@ -231,7 +231,7 @@
+
+ bool mime;
+
+- string_t *handle;
++ struct sieve_ast_argument *handle_arg;
+ };
+
+ /*
+@@ -348,10 +348,10 @@
+ *arg = sieve_ast_argument_next(*arg);
+
+ } else if ( sieve_argument_is(tag, vacation_handle_tag) ) {
+- ctx_data->handle = sieve_ast_argument_str(*arg);
+-
++ ctx_data->handle_arg = *arg;
++
+ /* Detach optional argument (emitted as mandatory) */
+- *arg = sieve_ast_arguments_detach(*arg,1);
++ *arg = sieve_ast_arguments_detach(*arg, 1);
+ }
+
+ return TRUE;
+@@ -468,34 +468,48 @@
+ return FALSE;
+
+ /* Construct handle if not set explicitly */
+- if ( ctx_data->handle == NULL ) {
+- string_t *reason = sieve_ast_argument_str(arg);
+- unsigned int size = str_len(reason);
++ if ( ctx_data->handle_arg == NULL ) {
++ T_BEGIN {
++ string_t *handle;
++ string_t *reason = sieve_ast_argument_str(arg);
++ unsigned int size = str_len(reason);
+
+- /* Precalculate the size of it all */
+- size += ctx_data->subject == NULL ?
+- sizeof(_handle_empty_subject) - 1 : str_len(ctx_data->subject);
+- size += ctx_data->from == NULL ?
+- sizeof(_handle_empty_from) - 1 : str_len(ctx_data->from);
+- size += ctx_data->mime ?
+- sizeof(_handle_mime_enabled) - 1 : sizeof(_handle_mime_disabled) - 1;
++ /* Precalculate the size of it all */
++ size += ctx_data->subject == NULL ?
++ sizeof(_handle_empty_subject) - 1 : str_len(ctx_data->subject);
++ size += ctx_data->from == NULL ?
++ sizeof(_handle_empty_from) - 1 : str_len(ctx_data->from);
++ size += ctx_data->mime ?
++ sizeof(_handle_mime_enabled) - 1 : sizeof(_handle_mime_disabled) - 1;
+
+- /* Construct the string */
+- ctx_data->handle = str_new(sieve_command_pool(cmd), size);
+- str_append_str(ctx_data->handle, reason);
++ /* Construct the string */
++ handle = t_str_new(size);
++ str_append_str(handle, reason);
+
+- if ( ctx_data->subject != NULL )
+- str_append_str(ctx_data->handle, ctx_data->subject);
+- else
+- str_append(ctx_data->handle, _handle_empty_subject);
++ if ( ctx_data->subject != NULL )
++ str_append_str(handle, ctx_data->subject);
++ else
++ str_append(handle, _handle_empty_subject);
+
+- if ( ctx_data->from != NULL )
+- str_append_str(ctx_data->handle, ctx_data->from);
+- else
+- str_append(ctx_data->handle, _handle_empty_from);
++ if ( ctx_data->from != NULL )
++ str_append_str(handle, ctx_data->from);
++ else
++ str_append(handle, _handle_empty_from);
+
+- str_append(ctx_data->handle,
+- ctx_data->mime ? _handle_mime_enabled : _handle_mime_disabled );
++ str_append(handle,
++ ctx_data->mime ? _handle_mime_enabled : _handle_mime_disabled );
++
++ /* Create positional handle argument */
++ ctx_data->handle_arg = sieve_ast_argument_string_create
++ (cmd->ast_node, handle, sieve_ast_node_line(cmd->ast_node));
++ } T_END;
++
++ if ( !sieve_validator_argument_activate
++ (valdtr, cmd, ctx_data->handle_arg, TRUE) )
++ return FALSE;
++ } else {
++ /* Attach explicit handle argument as positional */
++ (void)sieve_ast_argument_attach(cmd->ast_node, ctx_data->handle_arg);
+ }
+
+ return TRUE;
+@@ -507,18 +521,12 @@
+
+ static bool cmd_vacation_generate
+ (const struct sieve_codegen_env *cgenv, struct sieve_command *cmd)
+-{
+- struct cmd_vacation_context_data *ctx_data =
+- (struct cmd_vacation_context_data *) cmd->data;
+-
++{
+ sieve_operation_emit(cgenv->sblock, cmd->ext, &vacation_operation);
+
+ /* Generate arguments */
+ if ( !sieve_generate_arguments(cgenv, cmd, NULL) )
+ return FALSE;
+-
+- /* FIXME: this will not allow the handle to be a variable */
+- sieve_opr_string_emit(cgenv->sblock, ctx_data->handle);
+
+ return TRUE;
+ }
+@@ -779,13 +787,13 @@
+ (struct act_vacation_context *) action->context;
+
+ sieve_result_action_printf( rpenv, "send vacation message:");
+- sieve_result_printf(rpenv, " => seconds : %d\n", ctx->seconds);
++ sieve_result_printf(rpenv, " => seconds : %d\n", ctx->seconds);
+ if ( ctx->subject != NULL )
+- sieve_result_printf(rpenv, " => subject: %s\n", ctx->subject);
++ sieve_result_printf(rpenv, " => subject : %s\n", ctx->subject);
+ if ( ctx->from != NULL )
+- sieve_result_printf(rpenv, " => from : %s\n", ctx->from);
++ sieve_result_printf(rpenv, " => from : %s\n", ctx->from);
+ if ( ctx->handle != NULL )
+- sieve_result_printf(rpenv, " => handle : %s\n", ctx->handle);
++ sieve_result_printf(rpenv, " => handle : %s\n", ctx->handle);
+ sieve_result_printf(rpenv, "\nSTART MESSAGE\n%s\nEND MESSAGE\n", ctx->reason);
+ }
+
+
+
+
+