summaryrefslogtreecommitdiffstats
path: root/mail/dovecot
diff options
context:
space:
mode:
authornork <nork@FreeBSD.org>2003-04-19 17:42:27 +0000
committernork <nork@FreeBSD.org>2003-04-19 17:42:27 +0000
commit0b938893d6492476b2153b4e742ec256cafbe02a (patch)
tree99a51ce3a12105d54230341928b03a4757ceac95 /mail/dovecot
parent4f360736148bbdf45d1324a45387815ceb04ed7f (diff)
downloadFreeBSD-ports-0b938893d6492476b2153b4e742ec256cafbe02a.zip
FreeBSD-ports-0b938893d6492476b2153b4e742ec256cafbe02a.tar.gz
o obsolete rc.d script update
o addition of iconv dependancy o fix a number of problems PR: ports/50615, ports/49026, ports/49027 Submitted by: Dominic Marks <dom@cus.org.uk> (maintainer) Kimura Fuyuki <fuyuki@hadaly.org>
Diffstat (limited to 'mail/dovecot')
-rw-r--r--mail/dovecot/Makefile9
-rw-r--r--mail/dovecot/files/dovecot-imapd.sh6
-rw-r--r--mail/dovecot/files/patch-src::imap-fetch-body-section.c34
-rw-r--r--mail/dovecot/files/patch-src::imap::cmd-list.c109
-rw-r--r--mail/dovecot/files/patch-src::lib-imap::imap-parser.c30
-rw-r--r--mail/dovecot/files/patch-src::lib-storage::index::maildir::maildir-list.c12
-rw-r--r--mail/dovecot/files/patch-src::lib-storage::index::maildir::maildir-storage.c11
7 files changed, 207 insertions, 4 deletions
diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile
index 015bbcb..a84fd46 100644
--- a/mail/dovecot/Makefile
+++ b/mail/dovecot/Makefile
@@ -13,12 +13,16 @@ MASTER_SITES= http://dovecot.procontrol.fi/
MAINTAINER= d.marks@student.umist.ac.uk
COMMENT= Secure and compact IMAP and POP3 servers
+LIB_DEPENDS= iconv.3:${PORTSDIR}/converters/libiconv
+
USE_REINPLACE= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --without-shadow --enable-ipv6 \
--localstatedir=/var/dovecot --with-ssl=openssl \
--with-ssldir=/var/dovecot/ssl --with-pop3d \
--with-ldap --with-pam
+CONFIGURE_ENV+= CPPFLAGS=-I${LOCALBASE}/include \
+ LDFLAGS=-L${LOCALBASE}/lib
#
# SASL2 support
@@ -45,9 +49,12 @@ BUILD_DEPENDS+= ${VPOPMAIL}:${PORTSDIR}/mail/vpopmail
CONFIGURE_ARGS+= --with-vpopmail
.endif
-pre-build:
+post-patch:
@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' \
${WRKSRC}/dovecot-example.conf
+ @${REINPLACE_CMD} -e 's,^LIBS.*,& -liconv,' \
+ ${WRKSRC}/src/imap/Makefile.in \
+ ${WRKSRC}/src/pop3/Makefile.in
pre-install:
@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" \
diff --git a/mail/dovecot/files/dovecot-imapd.sh b/mail/dovecot/files/dovecot-imapd.sh
index 8295fbe..625021f 100644
--- a/mail/dovecot/files/dovecot-imapd.sh
+++ b/mail/dovecot/files/dovecot-imapd.sh
@@ -7,11 +7,11 @@ fi
case "$1" in
start)
- [ -x ${PREFIX}/sbin/imap-master ] && \
- ${PREFIX}/sbin/imap-master && echo -n ' dovecot-imapd'
+ [ -x ${PREFIX}/sbin/dovecot ] && \
+ ${PREFIX}/sbin/dovecot && echo -n ' dovecot'
;;
stop)
- /usr/bin/killall imap-master && echo -n ' dovecot-imapd'
+ /usr/bin/killall dovecot && echo -n ' dovecot'
;;
*)
echo "Usage: `basename $0` { start | stop }" >&2
diff --git a/mail/dovecot/files/patch-src::imap-fetch-body-section.c b/mail/dovecot/files/patch-src::imap-fetch-body-section.c
new file mode 100644
index 0000000..8da8100
--- /dev/null
+++ b/mail/dovecot/files/patch-src::imap-fetch-body-section.c
@@ -0,0 +1,34 @@
+--- src/imap/imap-fetch-body-section.c.orig Sun Jan 26 10:38:34 2003
++++ src/imap/imap-fetch-body-section.c Sun Apr 20 02:33:03 2003
+@@ -78,6 +78,7 @@
+ struct istream *stream;
+ const char *str;
+ int skip_cr;
++ uoff_t size;
+ off_t ret;
+
+ stream = mail->get_stream(mail, &hdr_size, &body_size);
+@@ -87,8 +88,13 @@
+ if (fetch_header)
+ message_size_add(&body_size, &hdr_size);
+
+- str = t_strdup_printf("%s {%"PRIuUOFF_T"}\r\n",
+- ctx->prefix, body_size.virtual_size);
++ if (body->skip >= body_size.virtual_size)
++ size = 0;
++ else {
++ size = body_size.virtual_size - body->skip;
++ if (size > body->max_size) size = body->max_size;
++ }
++ str = t_strdup_printf("%s {%"PRIuUOFF_T"}\r\n", ctx->prefix, size);
+ if (o_stream_send_str(ctx->output, str) < 0)
+ return FALSE;
+
+@@ -96,6 +102,7 @@
+ &partial, stream,
+ fetch_header ? 0 : hdr_size.physical_size,
+ body->skip);
++
+ ret = message_send(ctx->output, stream, &body_size,
+ skip_cr, body->max_size);
+ if (ret > 0) {
diff --git a/mail/dovecot/files/patch-src::imap::cmd-list.c b/mail/dovecot/files/patch-src::imap::cmd-list.c
new file mode 100644
index 0000000..b677441
--- /dev/null
+++ b/mail/dovecot/files/patch-src::imap::cmd-list.c
@@ -0,0 +1,109 @@
+--- src/imap/cmd-list.c.orig Wed Feb 26 05:58:45 2003
++++ src/imap/cmd-list.c Sun Apr 20 02:32:27 2003
+@@ -24,16 +24,17 @@
+ const char *response_name;
+ const char *sep;
+ struct imap_match_glob *glob;
+- int listext;
++ int listext, no_placeholder;
+ };
+
+-static const char *mailbox_flags2str(enum mailbox_flags flags, int listext)
++static const char *mailbox_flags2str(enum mailbox_flags flags,
++ int listext, int no_placeholder)
+ {
+ const char *str;
+
+ if (flags & MAILBOX_PLACEHOLDER) {
+- if (flags == MAILBOX_PLACEHOLDER) {
+- if (!listext)
++ if ((flags & ~MAILBOX_CHILDREN) == MAILBOX_PLACEHOLDER) {
++ if (!listext || no_placeholder)
+ flags = MAILBOX_NOSELECT;
+ } else {
+ /* it was at one point, but then we got better specs */
+@@ -59,7 +60,6 @@
+
+ static void list_node_update(pool_t pool, struct list_node **node,
+ const char *path, char separator,
+- enum mailbox_flags dir_flags,
+ enum mailbox_flags flags)
+ {
+ const char *name, *parent;
+@@ -88,7 +88,8 @@
+ /* not found, create it */
+ *node = p_new(pool, struct list_node, 1);
+ (*node)->name = p_strdup(pool, name);
+- (*node)->flags = *path == '\0' ? flags : dir_flags;
++ (*node)->flags = *path == '\0' ? flags :
++ MAILBOX_PLACEHOLDER;
+ } else {
+ if (*path == '\0') {
+ if (((*node)->flags & MAILBOX_NOSELECT) != 0 &&
+@@ -139,16 +140,24 @@
+
+ buf = str_unescape(t_strdup_noconst(name));
+ match = imap_match(ctx->glob, buf);
+- if (match == IMAP_MATCH_CHILDREN) {
++ /* FIXME: IMAP spec says this should be done, but
++ a) this is broken, we shouldn't give \NoSelect for
++ this folder if it actually works.
++ b) at least mozilla's subscriptions list breaks if
++ this is sent
++ c) cyrus and courier doesn't do this either..
++
++ if (match == IMAP_MATCH_CHILDREN) {
+ send_name = t_strconcat(name, ctx->sep, NULL);
+ buf = str_unescape(t_strdup_noconst(send_name));
+ match = imap_match(ctx->glob, buf);
+- }
++ }*/
+ }
+
+ if (match == IMAP_MATCH_YES) {
+ /* node->name should already be escaped */
+- flagstr = mailbox_flags2str(node->flags, ctx->listext);
++ flagstr = mailbox_flags2str(node->flags, ctx->listext,
++ ctx->no_placeholder);
+ str = t_strdup_printf("* %s (%s) \"%s\" \"%s\"",
+ ctx->response_name, flagstr,
+ ctx->sep, send_name);
+@@ -171,19 +180,15 @@
+ struct mailbox_list *list;
+ struct list_node *nodes;
+ struct list_send_context send_ctx;
+- enum mailbox_flags dir_flags;
+ pool_t pool;
+
+- dir_flags = (list_flags & MAILBOX_LIST_SUBSCRIBED) ?
+- MAILBOX_PLACEHOLDER : MAILBOX_NOSELECT;
+-
+ pool = pool_alloconly_create("list_mailboxes", 10240);
+ nodes = NULL;
+
+ while ((list = client->storage->list_mailbox_next(ctx)) != NULL) {
+ list_node_update(pool, &nodes, list->name,
+ client->storage->hierarchy_sep,
+- dir_flags, list->flags);
++ list->flags);
+ }
+
+ send_ctx.client = client;
+@@ -192,6 +197,7 @@
+ send_ctx.glob = imap_match_init(data_stack_pool, mask, TRUE,
+ client->storage->hierarchy_sep);
+ send_ctx.listext = listext;
++ send_ctx.no_placeholder = (list_flags & MAILBOX_LIST_SUBSCRIBED) == 0;
+
+ list_send(&send_ctx, nodes, NULL);
+ imap_match_deinit(send_ctx.glob);
+@@ -212,7 +218,8 @@
+ else
+ name = str_escape(list->name);
+ str = t_strdup_printf("* %s (%s) \"%s\" \"%s\"", reply,
+- mailbox_flags2str(list->flags, listext),
++ mailbox_flags2str(list->flags, listext,
++ FALSE),
+ sep, name);
+ client_send_line(client, str);
+ t_pop();
diff --git a/mail/dovecot/files/patch-src::lib-imap::imap-parser.c b/mail/dovecot/files/patch-src::lib-imap::imap-parser.c
new file mode 100644
index 0000000..d9f82ee
--- /dev/null
+++ b/mail/dovecot/files/patch-src::lib-imap::imap-parser.c
@@ -0,0 +1,30 @@
+--- src/lib-imap/imap-parser.c.orig Wed Mar 12 06:05:57 2003
++++ src/lib-imap/imap-parser.c Sun Apr 20 02:32:45 2003
+@@ -451,7 +451,6 @@
+ imap_parser_save_arg(parser, data,
+ (size_t)parser->literal_size);
+ parser->cur_pos = (size_t)parser->literal_size;
+- parser->eol = TRUE;
+ return TRUE;
+ }
+ } else {
+@@ -560,8 +559,8 @@
+ {
+ parser->flags = flags;
+
+- while (count == 0 || parser->root_list->size < count ||
+- IS_UNFINISHED(parser)) {
++ while (!parser->eol && (count == 0 || parser->root_list->size < count ||
++ IS_UNFINISHED(parser))) {
+ if (!imap_parser_read_arg(parser))
+ break;
+
+@@ -580,7 +579,7 @@
+ } else if ((!IS_UNFINISHED(parser) && count > 0 &&
+ parser->root_list->size >= count) || parser->eol) {
+ /* all arguments read / end of line. */
+- i_stream_skip(parser->input, parser->cur_pos);
++ i_stream_skip(parser->input, parser->cur_pos);
+ parser->cur_pos = 0;
+
+ if (parser->list_arg != NULL) {
diff --git a/mail/dovecot/files/patch-src::lib-storage::index::maildir::maildir-list.c b/mail/dovecot/files/patch-src::lib-storage::index::maildir::maildir-list.c
new file mode 100644
index 0000000..f99c846
--- /dev/null
+++ b/mail/dovecot/files/patch-src::lib-storage::index::maildir::maildir-list.c
@@ -0,0 +1,12 @@
+--- src/lib-storage/index/maildir/maildir-list.c.orig Wed Feb 26 05:58:45 2003
++++ src/lib-storage/index/maildir/maildir-list.c Sun Apr 20 02:36:41 2003
+@@ -242,7 +242,8 @@
+ continue; /* ignore inboxes */
+
+ if (match == IMAP_MATCH_PARENT) {
+- ctx->list.flags = MAILBOX_NOSELECT;
++ ctx->list.flags =
++ MAILBOX_PLACEHOLDER | MAILBOX_CHILDREN;
+ while ((p = strrchr(fname, '.')) != NULL) {
+ fname = t_strdup_until(fname, p);
+ if (imap_match(ctx->glob, fname) > 0) {
diff --git a/mail/dovecot/files/patch-src::lib-storage::index::maildir::maildir-storage.c b/mail/dovecot/files/patch-src::lib-storage::index::maildir::maildir-storage.c
new file mode 100644
index 0000000..4dccbc5
--- /dev/null
+++ b/mail/dovecot/files/patch-src::lib-storage::index::maildir::maildir-storage.c
@@ -0,0 +1,11 @@
+--- src/lib-storage/index/maildir/maildir-storage.c.orig Wed Feb 26 05:58:45 2003
++++ src/lib-storage/index/maildir/maildir-storage.c Sun Apr 20 02:33:17 2003
+@@ -434,7 +434,7 @@
+ i_assert(oldnamelen <= strlen(list->name));
+
+ t_push();
+- new_listname = t_strconcat(newname, ".",
++ new_listname = t_strconcat(newname,
+ list->name + oldnamelen, NULL);
+ oldpath = maildir_get_path(storage, list->name);
+ newpath = maildir_get_path(storage, new_listname);
OpenPOWER on IntegriCloud