From owner-svn-ports-head@freebsd.org Wed Mar 1 17:55:59 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72616CF348D; Wed, 1 Mar 2017 17:55:59 +0000 (UTC) (envelope-from adamw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32F1DEA9; Wed, 1 Mar 2017 17:55:59 +0000 (UTC) (envelope-from adamw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21HtwXM039431; Wed, 1 Mar 2017 17:55:58 GMT (envelope-from adamw@FreeBSD.org) Received: (from adamw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21Htw0E039429; Wed, 1 Mar 2017 17:55:58 GMT (envelope-from adamw@FreeBSD.org) Message-Id: <201703011755.v21Htw0E039429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adamw set sender to adamw@FreeBSD.org using -f From: Adam Weinberger Date: Wed, 1 Mar 2017 17:55:58 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r435188 - in head/mail/dovecot2: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 17:55:59 -0000 Author: adamw Date: Wed Mar 1 17:55:58 2017 New Revision: 435188 URL: https://svnweb.freebsd.org/changeset/ports/435188 Log: Add a patch from upstream that fixes a crash with the trash plugin: Panic: file mail-namespace.c: line 709 (mail_namespace_find): assertion failed: (ns != NULL) Bump PORTREVISION. PR: 217364 Submitted by: Max Kostikov Obtained from: https://github.com/dovecot/core/commit/326fb016a23480e4ff8dcc03dc80e76812859bd6.patch Added: head/mail/dovecot2/files/patch-trash_plugin (contents, props changed) Modified: head/mail/dovecot2/Makefile Modified: head/mail/dovecot2/Makefile ============================================================================== --- head/mail/dovecot2/Makefile Wed Mar 1 17:53:53 2017 (r435187) +++ head/mail/dovecot2/Makefile Wed Mar 1 17:55:58 2017 (r435188) @@ -14,6 +14,7 @@ PORTNAME= dovecot PORTVERSION= 2.2.28 +PORTREVISION= 1 CATEGORIES= mail ipv6 MASTER_SITES= https://www.dovecot.org/releases/${PORTVERSION:R}/ PKGNAMESUFFIX= 2 Added: head/mail/dovecot2/files/patch-trash_plugin ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/dovecot2/files/patch-trash_plugin Wed Mar 1 17:55:58 2017 (r435188) @@ -0,0 +1,48 @@ +From 326fb016a23480e4ff8dcc03dc80e76812859bd6 Mon Sep 17 00:00:00 2001 +From: Aki Tuomi +Date: Wed, 1 Mar 2017 09:15:29 +0200 +Subject: [PATCH] trash: Read settings after namespaces are loaded + +Fixes Panic: file mail-namespace.c: line 709 (mail_namespace_find): assertion failed: (ns != NULL) +--- + src/plugins/trash/trash-plugin.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/src/plugins/trash/trash-plugin.c b/src/plugins/trash/trash-plugin.c +index 7129d3d..2e12578 100644 +--- src/plugins/trash/trash-plugin.c ++++ src/plugins/trash/trash-plugin.c +@@ -348,17 +348,27 @@ trash_mail_user_created(struct mail_user *user) + } else { + tuser = p_new(user->pool, struct trash_user, 1); + MODULE_CONTEXT_SET(user, trash_user_module, tuser); ++ } ++} + +- if (read_configuration(user, env) == 0) { +- trash_next_quota_test_alloc = +- quser->quota->set->test_alloc; +- quser->quota->set->test_alloc = trash_quota_test_alloc; +- } ++static void ++trash_mail_namespaces_created(struct mail_namespace *namespaces) ++{ ++ struct mail_user *user = namespaces->user; ++ struct trash_user *tuser = TRASH_USER_CONTEXT(user); ++ struct quota_user *quser = QUOTA_USER_CONTEXT(user); ++ const char *env = mail_user_plugin_getenv(user, "trash"); ++ ++ if (tuser != NULL && read_configuration(user, env) == 0) { ++ trash_next_quota_test_alloc = ++ quser->quota->set->test_alloc; ++ quser->quota->set->test_alloc = trash_quota_test_alloc; + } + } + + static struct mail_storage_hooks trash_mail_storage_hooks = { +- .mail_user_created = trash_mail_user_created ++ .mail_user_created = trash_mail_user_created, ++ .mail_namespaces_created = trash_mail_namespaces_created, + }; + + void trash_plugin_init(struct module *module)