- initialize /var/dovecot/login via INSTALL to quell a warning about it

not existing (and thus be created by dovecot itself)
- incorporate upstream patch which prevents some partial BODY[part]
  fetches from possibly returning data incorrectly
- bump PKGNAME
This commit is contained in:
jolan 2003-11-05 03:42:06 +00:00
parent 97a47c40f8
commit d037112145
3 changed files with 118 additions and 3 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.3 2003/09/23 06:34:32 jolan Exp $
# $OpenBSD: Makefile,v 1.4 2003/11/05 03:42:06 jolan Exp $
COMMENT= "compact IMAP/POP3 server"
DISTNAME= dovecot-0.99.10
PKGNAME= ${DISTNAME}p1
PKGNAME= ${DISTNAME}p2
CATEGORIES= mail
MASTER_SITES= ${HOMEPAGE}

View File

@ -0,0 +1,105 @@
$OpenBSD: patch-src_imap_imap-fetch-body-section_c,v 1.1 2003/11/05 03:42:06 jolan Exp $
--- src/imap/imap-fetch-body-section.c.orig 2003-06-04 16:45:42.000000000 -0500
+++ src/imap/imap-fetch-body-section.c 2003-11-04 20:34:00.000000000 -0600
@@ -70,6 +70,18 @@ static int seek_partial(unsigned int sel
return cr_skipped;
}
+static uoff_t get_send_size(const struct imap_fetch_body_data *body,
+ uoff_t max_size)
+{
+ uoff_t size;
+
+ if (body->skip >= max_size)
+ return 0;
+
+ size = max_size - body->skip;
+ return size <= body->max_size ? size : body->max_size;
+}
+
/* fetch BODY[] or BODY[TEXT] */
static int fetch_body(struct imap_fetch_context *ctx,
const struct imap_fetch_body_data *body,
@@ -79,7 +91,7 @@ static int fetch_body(struct imap_fetch_
struct istream *stream;
const char *str;
int skip_cr, last_cr;
- uoff_t size;
+ uoff_t send_size;
off_t ret;
stream = mail->get_stream(mail, &hdr_size, &body_size);
@@ -89,13 +101,8 @@ static int fetch_body(struct imap_fetch_
if (fetch_header)
message_size_add(&body_size, &hdr_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);
+ send_size = get_send_size(body, body_size.virtual_size);
+ str = t_strdup_printf("%s {%"PRIuUOFF_T"}\r\n", ctx->prefix, send_size);
if (o_stream_send_str(ctx->output, str) < 0)
return FALSE;
@@ -105,7 +112,7 @@ static int fetch_body(struct imap_fetch_
body->skip);
ret = message_send(ctx->output, stream, &body_size,
- skip_cr, body->max_size, &last_cr,
+ skip_cr, send_size, &last_cr,
!mail->has_no_nuls);
if (ret > 0) {
partial.cr_skipped = last_cr != 0;
@@ -308,15 +315,16 @@ static int fetch_header_from(struct imap
const char *str;
const void *data;
size_t data_size;
- uoff_t start_offset;
+ uoff_t start_offset, send_size;
int failed;
/* HEADER, MIME, HEADER.FIELDS (list), HEADER.FIELDS.NOT (list) */
if (strcmp(header_section, "HEADER") == 0) {
/* all headers */
+ send_size = get_send_size(body, size->virtual_size);
str = t_strdup_printf("%s {%"PRIuUOFF_T"}\r\n",
- ctx->prefix, size->virtual_size);
+ ctx->prefix, send_size);
if (o_stream_send_str(ctx->output, str) < 0)
return FALSE;
return message_send(ctx->output, input, size,
@@ -457,16 +465,11 @@ static int fetch_part_body(struct imap_f
{
const char *str;
int skip_cr, last_cr;
- uoff_t size;
+ uoff_t send_size;
off_t ret;
- if (body->skip >= part->body_size.virtual_size)
- size = 0;
- else {
- size = part->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);
+ send_size = get_send_size(body, part->body_size.virtual_size);
+ str = t_strdup_printf("%s {%"PRIuUOFF_T"}\r\n", ctx->prefix, send_size);
if (o_stream_send_str(ctx->output, str) < 0)
return FALSE;
@@ -474,8 +477,7 @@ static int fetch_part_body(struct imap_f
&partial, stream, part->physical_pos +
part->header_size.physical_size, body->skip);
ret = message_send(ctx->output, stream, &part->body_size,
- skip_cr, body->max_size, &last_cr,
- !mail->has_no_nuls);
+ skip_cr, send_size, &last_cr, !mail->has_no_nuls);
if (ret > 0) {
partial.cr_skipped = last_cr != 0;
partial.pos.physical_size =

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.2 2003/07/23 06:03:01 jolan Exp $
# $OpenBSD: INSTALL,v 1.3 2003/11/05 03:42:06 jolan Exp $
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
SYSCONFDIR=${SYSCONFDIR:-/etc}
@ -9,6 +9,7 @@ SSL_FILE=$SSL_DIR/dovecot-openssl.cnf
SAMPLE_CONFIG_DIR=$PREFIX/share/examples/dovecot
SAMPLE_CONFIG_FILE=$SAMPLE_CONFIG_DIR/dovecot-example.conf
SAMPLE_SSL_FILE=$SAMPLE_CONFIG_DIR/dovecot-openssl.cnf
DOVECOTDIR=/var/dovecot
DOVECOTUSER=_dovecot
DOVECOTGROUP=_dovecot
ID=518
@ -81,6 +82,12 @@ do_ssl_install()
echo
}
do_var_install()
{
install -d -o root -g wheel -m 700 $DOVECOTDIR
install -d -o root -g $DOVECOTGROUP -m 750 $DOVECOTDIR/login
}
# verify proper execution
#
if [ $# -ne 2 ]; then
@ -105,6 +112,9 @@ case $2 in
else
do_ssl_notice $1
fi
if [ ! -d $DOVECOTDIR ]; then
do_var_install
fi
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2