Index: head/mail/mailutils/Makefile =================================================================== --- head/mail/mailutils/Makefile (revision 507706) +++ head/mail/mailutils/Makefile (revision 507707) @@ -1,104 +1,107 @@ # Created by: Attila Nagy # $FreeBSD$ PORTNAME= mailutils PORTVERSION= 3.7 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail MASTER_SITES= GNU GNU_ALPHA + +EXTRA_PATCHES= ${FILESDIR}/git-018df5d:-p1 \ + ${FILESDIR}/git-113e144:-p1 MAINTAINER= zeus@gnu.org.ua COMMENT= Utilities, daemons, and filters for processing e-mail LICENSE= GPLv3+ LIB_DEPENDS= libltdl.so:devel/libltdl USES= gmake iconv libtool localbase readline tar:xz GNU_CONFIGURE= yes USE_LDCONFIG= yes USE_RC_SUBR= comsatd imap4d pop3d INSTALL_TARGET= install-strip PLIST_SUB+= LIBVERSION=6.0.0 LIBSUFX=6 VERSION=${PORTVERSION} INFO= ${PORTNAME} PORTDOCS= AUTHORS ChangeLog NEWS README* THANKS TODO OPTIONS_DEFINE= DEBUG DOCS EMACS GNUTLS GSSAPI GUILE MH NNTP NLS \ PAM PYTHON OPTIONS_DEFAULT= GDBM GNUTLS PAM OPTIONS_MULTI= DB OPTIONS_MULTI_DB= BDB GDBM KYOTOCABINET LDAP MYSQL PGSQL TOKYOCABINET OPTIONS_SUB= yes DB_DESC= Database configuration EMACS_DESC= Emacs interface to MH (implies MH) KYOTOCABINET_DESC= Kyoto Cabinet database support MH_DESC= MH (Message Handling) system support TOKYOCABINET_DESC= Tokyo Cabinet database support DEBUG_CONFIGURE_ON= --enable-debug EMACS_USES= emacs:build EMACS_IMPLIES= MH GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls GNUTLS_CONFIGURE_WITH= gnutls GSSAPI_RUN_DEPENDS= cyrus-sasl-gssapi>0:security/cyrus-sasl2-gssapi GSSAPI_CONFIGURE_WITH= gssapi GUILE_LIB_DEPENDS= libguile-2.2.so:lang/guile2 libgmp.so:math/gmp GUILE_USES= makeinfo pkgconfig GUILE_CONFIGURE_WITH= guile MH_CONFIGURE_ENABLE= mh NNTP_CONFIGURE_ENABLE= nntp NLS_USES= gettext NLS_CONFIGURE_ENABLE= nls PAM_CONFIGURE_ENABLE= pam PYTHON_BINARY_ALIAS= python-config=python${PYTHON_VER}-config PYTHON_USES= python:2.7 PYTHON_CONFIGURE_ENABLE=python BDB_USES= bdb BDB_CONFIGURE_WITH= berkeley-db BDB_CPPFLAGS= -I${BDB_INCLUDE_DIR} BDB_LDFLAGS= -L${BDB_LIB_DIR} GDBM_LIB_DEPENDS= libgdbm.so:databases/gdbm GDBM_CONFIGURE_WITH= gdbm KYOTOCABINET_LIB_DEPENDS= libkyotocabinet.so:databases/kyotocabinet KYOTOCABINET_CONFIGURE_WITH= kyotocabinet LDAP_USE= OPENLDAP=yes LDAP_CONFIGURE_WITH= ldap MYSQL_USES= mysql MYSQL_CONFIGURE_WITH= mysql PGSQL_USES= pgsql PGSQL_CONFIGURE_WITH= postgres TOKYOCABINET_LIB_DEPENDS= libtokyocabinet.so:databases/tokyocabinet TOKYOCABINET_CONFIGURE_WITH= tokyocabinet post-patch: @${REINPLACE_CMD} -e '/need_charset_alias=/s|true|false|' \ ${WRKSRC}/lib/gnu/Makefile.in @${REINPLACE_CMD} -e '/chown/,+1s|ch|#&|' \ ${WRKSRC}/dotlock/Makefile.in \ ${WRKSRC}/maidag/Makefile.in @${REINPLACE_CMD} -e 's,-E,& -P,' ${WRKSRC}/libmu_scm/Makefile.in post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} .include Index: head/mail/mailutils/files/git-018df5d =================================================================== --- head/mail/mailutils/files/git-018df5d (nonexistent) +++ head/mail/mailutils/files/git-018df5d (revision 507707) @@ -0,0 +1,277 @@ +From 018df5d628f4e093f7e45c00b48ffc11b234d8cf Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Tue, 23 Jul 2019 08:04:38 +0300 +Subject: Minor fix + +Check return from mu_message_get_num_parts +--- + imap4d/fetch.c | 32 ++++++++++++++++++------------- + imap4d/search.c | 24 ++++++++++++++--------- + libmu_scm/tests/testsuite.at | 2 +- + libmu_sieve/extensions/moderator.c | 9 +++++++-- + libmu_sieve/tests.c | 15 +++++++++++---- + mail/decode.c | 39 ++++++++++++++++++++++---------------- + mh/burst.c | 8 +++++++- + mh/mhn.c | 12 +++++++++--- + 8 files changed, 92 insertions(+), 49 deletions(-) + +diff --git a/imap4d/fetch.c b/imap4d/fetch.c +index 51921dd..fa0cea6 100644 +--- a/imap4d/fetch.c ++++ b/imap4d/fetch.c +@@ -491,7 +491,6 @@ bodystructure (mu_message_t msg, int extension) + static int + fetch_bodystructure0 (mu_message_t message, int extension) + { +- size_t nparts = 1; + size_t i; + int is_multipart = 0; + +@@ -500,20 +499,27 @@ fetch_bodystructure0 (mu_message_t message, int extension) + { + mu_content_type_t ct; + mu_header_t header = NULL; ++ size_t nparts; + int rc; + +- mu_message_get_num_parts (message, &nparts); +- +- /* Get all the sub messages. */ +- for (i = 1; i <= nparts; i++) +- { +- mu_message_t msg = NULL; +- mu_message_get_part (message, i, &msg); +- io_sendf ("("); +- fetch_bodystructure0 (msg, extension); +- io_sendf (")"); +- } /* for () */ +- ++ rc = mu_message_get_num_parts (message, &nparts); ++ if (rc) ++ { ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", NULL, rc); ++ } ++ else ++ { ++ /* Get all the sub messages. */ ++ for (i = 1; i <= nparts; i++) ++ { ++ mu_message_t msg = NULL; ++ mu_message_get_part (message, i, &msg); ++ io_sendf ("("); ++ fetch_bodystructure0 (msg, extension); ++ io_sendf (")"); ++ } /* for () */ ++ } ++ + mu_message_get_header (message, &header); + + /* The subtype. */ +diff --git a/imap4d/search.c b/imap4d/search.c +index 8bc9770..0037964 100644 +--- a/imap4d/search.c ++++ b/imap4d/search.c +@@ -1019,17 +1019,23 @@ _match_multipart (struct parsebuf *pb, mu_message_t msg, char *text) + { + size_t i, nparts; + +- mu_message_get_num_parts (msg, &nparts); +- +- for (i = 1; i <= nparts; i++) ++ rc = mu_message_get_num_parts (msg, &nparts); ++ if (rc) + { +- mu_message_t submsg = NULL; +- +- if (mu_message_get_part (msg, i, &submsg) == 0) ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", NULL, rc); ++ } ++ else ++ { ++ for (i = 1; i <= nparts; i++) + { +- result = _match_multipart (pb, submsg, text); +- if (result) +- break; ++ mu_message_t submsg = NULL; ++ ++ if (mu_message_get_part (msg, i, &submsg) == 0) ++ { ++ result = _match_multipart (pb, submsg, text); ++ if (result) ++ break; ++ } + } + } + } +diff --git a/libmu_scm/tests/testsuite.at b/libmu_scm/tests/testsuite.at +index 6bd1947..ba445f7 100644 +--- a/libmu_scm/tests/testsuite.at ++++ b/libmu_scm/tests/testsuite.at +@@ -14,7 +14,7 @@ m4_define([MU_GUILE_CHECK], + [AT_DATA([input.scm],[dnl + (use-modules ((mailutils mailutils)) + ((mailutils ancilla))) +-(mu-register-format "mbox") ++(mu-register-format "mbox") + [$1] + ]) + m4_if(MU_TEST_MAILBOX,,,[MUT_MBCOPY($abs_top_srcdir/testsuite/MU_TEST_MAILBOX,mbox)]) +diff --git a/libmu_sieve/extensions/moderator.c b/libmu_sieve/extensions/moderator.c +index 3544d88..4fe2e83 100644 +--- a/libmu_sieve/extensions/moderator.c ++++ b/libmu_sieve/extensions/moderator.c +@@ -284,8 +284,13 @@ moderator_action (mu_sieve_machine_t mach) + mu_sieve_abort (mach); + } + +- mu_message_get_num_parts (msg, &nparts); +- ++ rc = mu_message_get_num_parts (msg, &nparts); ++ if (rc) ++ { ++ mu_sieve_error (mach, "mu_message_get_num_parts: %s", mu_strerror (rc)); ++ mu_sieve_abort (mach); ++ } ++ + if (nparts != 3) /* Mailman moderation requests have three parts */ + { + mu_sieve_error (mach, _("expected 3 parts, but found %lu"), +diff --git a/libmu_sieve/tests.c b/libmu_sieve/tests.c +index da3872f..c346747 100644 +--- a/libmu_sieve/tests.c ++++ b/libmu_sieve/tests.c +@@ -176,17 +176,24 @@ sieve_test_header (mu_sieve_machine_t mach) + v = mu_sieve_get_arg_untyped (mach, 1); + + clos.message = mach->msg; ++ clos.nparts = 0; + + if (mu_sieve_get_tag (mach, "mime", SVT_VOID, NULL)) + { + int ismime = 0; + +- mu_message_is_multipart (mach->msg, &ismime); ++ rc = mu_message_is_multipart (mach->msg, &ismime); ++ if (rc) ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_is_multipart", ++ NULL, rc); + if (ismime) +- mu_message_get_num_parts (mach->msg, &clos.nparts); ++ { ++ rc = mu_message_get_num_parts (mach->msg, &clos.nparts); ++ if (rc) ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", ++ NULL, rc); ++ } + } +- else +- clos.nparts = 0; + + rc = mu_sieve_vlist_compare (mach, h, v, retrieve_header, NULL, &clos); + return rc; +diff --git a/mail/decode.c b/mail/decode.c +index 869fe2f..647f8cf 100644 +--- a/mail/decode.c ++++ b/mail/decode.c +@@ -172,7 +172,6 @@ mime_descend (struct mime_descend_closure *closure, + mime_descend_fn fun, void *data) + { + int status = 0; +- size_t nparts = 0; + mu_header_t hdr = NULL; + char *type; + char *encoding; +@@ -195,23 +194,31 @@ mime_descend (struct mime_descend_closure *closure, + if (ismime) + { + unsigned int j; +- +- mu_message_get_num_parts (closure->message, &nparts); +- +- for (j = 1; j <= nparts; j++) ++ size_t nparts; ++ ++ status = mu_message_get_num_parts (closure->message, &nparts); ++ if (status) + { +- mu_message_t message = NULL; +- +- if (mu_message_get_part (closure->message, j, &message) == 0) ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", NULL, ++ status); ++ } ++ else ++ { ++ for (j = 1; j <= nparts; j++) + { +- msgset_t *set = msgset_expand (msgset_dup (closure->msgset), +- msgset_make_1 (j)); +- subclosure.msgset = set; +- subclosure.message = message; +- status = mime_descend (&subclosure, fun, data); +- msgset_free (set); +- if (status) +- break; ++ mu_message_t message = NULL; ++ ++ if (mu_message_get_part (closure->message, j, &message) == 0) ++ { ++ msgset_t *set = msgset_expand (msgset_dup (closure->msgset), ++ msgset_make_1 (j)); ++ subclosure.msgset = set; ++ subclosure.message = message; ++ status = mime_descend (&subclosure, fun, data); ++ msgset_free (set); ++ if (status) ++ break; ++ } + } + } + } +diff --git a/mh/burst.c b/mh/burst.c +index b512fa0..af04317 100644 +--- a/mh/burst.c ++++ b/mh/burst.c +@@ -75,8 +75,14 @@ int + burst_mime (mu_message_t msg) + { + size_t i, nparts; ++ int rc; + +- mu_message_get_num_parts (msg, &nparts); ++ rc = mu_message_get_num_parts (msg, &nparts); ++ if (rc) ++ { ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", NULL, rc); ++ return rc; ++ } + + for (i = 1; i <= nparts; i++) + { +diff --git a/mh/mhn.c b/mh/mhn.c +index 8559261..ebe0e75 100644 +--- a/mh/mhn.c ++++ b/mh/mhn.c +@@ -1047,9 +1047,15 @@ handle_message (mu_message_t msg, msg_part_t part, msg_handler_t fun, void *data + if (ismime) + { + size_t i, nparts; +- +- mu_message_get_num_parts (msg, &nparts); +- ++ int rc; ++ ++ rc = mu_message_get_num_parts (msg, &nparts); ++ if (rc) ++ { ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", NULL, rc); ++ return rc; ++ } ++ + msg_part_incr (part); + for (i = 1; i <= nparts; i++) + { +-- +cgit v1.0-41-gc330 + Property changes on: head/mail/mailutils/files/git-018df5d ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/mail/mailutils/files/git-113e144 =================================================================== --- head/mail/mailutils/files/git-113e144 (nonexistent) +++ head/mail/mailutils/files/git-113e144 (revision 507707) @@ -0,0 +1,38 @@ +From 113e144dedbebb5bc659eadc7f329450bb374606 Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Tue, 23 Jul 2019 11:08:04 +0300 +Subject: Fix mandatory locking + +* lib/manlock.c (mailbox_open_and_lock): Force proper locker if +a null locker is associated with the mailbox. +--- + lib/manlock.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/lib/manlock.c b/lib/manlock.c +index 4a3b2be..392c581 100644 +--- a/lib/manlock.c ++++ b/lib/manlock.c +@@ -126,6 +126,19 @@ mailbox_open_and_lock (mu_mailbox_t mbox, int flags) + return MU_ERR_FAILURE; + } + ++ if (lock) ++ { ++ status = mu_locker_get_flags (lock, &flags); ++ if (status) ++ { ++ mu_diag_funcall (MU_DIAG_ERROR, "mu_locker_get_flags", urlstr, ++ status); ++ return MU_ERR_FAILURE; ++ } ++ if (flags & MU_LOCKER_NULL) ++ lock = NULL; ++ } ++ + if (!lock && manlock_mandatory_locking && manlock_lock_dir) + { + char *fname = NULL; +-- +cgit v1.0-41-gc330 + Property changes on: head/mail/mailutils/files/git-113e144 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property