SHA256
1
0
forked from pool/dovecot23

- backport 321a39be974deb2e7eff7b2a509a3ee6ff2e5ae1.patch

fixes crash with imap sieve

OBS-URL: https://build.opensuse.org/package/show/server:mail/dovecot23?expand=0&rev=2
This commit is contained in:
Marcus Rückert 2017-12-25 18:51:39 +00:00 committed by Git OBS Bridge
parent 0235820ac5
commit c8ae08e7fc
3 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,61 @@
From 321a39be974deb2e7eff7b2a509a3ee6ff2e5ae1 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@dovecot.fi>
Date: Mon, 25 Dec 2017 18:20:14 +0100
Subject: [PATCH] plugins: sieve-extprograms: Fix segfault occurring when used
in IMAPSieve context.
This was caused by recent lib-smtp changes.
There is no envelope in IMAPSieve context, so the rcpt parameters are NULL, causing the segfault.
---
.../sieve-extprograms/sieve-extprograms-common.c | 29 +++++++++++++---------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/src/plugins/sieve-extprograms/sieve-extprograms-common.c b/src/plugins/sieve-extprograms/sieve-extprograms-common.c
index 8fef2f53..5f0ed728 100644
--- a/src/plugins/sieve-extprograms/sieve-extprograms-common.c
+++ b/src/plugins/sieve-extprograms/sieve-extprograms-common.c
@@ -415,6 +415,7 @@ struct sieve_extprogram *sieve_extprogram_create
struct sieve_instance *svinst = ext->svinst;
struct sieve_extprograms_config *ext_config =
(struct sieve_extprograms_config *) ext->context;
+ const struct smtp_address *sender, *recipient, *orig_recipient;
struct sieve_extprogram *sprog;
const char *path = NULL;
struct stat st;
@@ -549,20 +550,24 @@ struct sieve_extprogram *sieve_extprogram_create
program_client_set_env(sprog->program_client, "HOME", svinst->home_dir);
if ( svinst->hostname != NULL )
program_client_set_env(sprog->program_client, "HOST", svinst->hostname);
- if ( !smtp_address_isnull(msgdata->envelope.mail_from) ) {
- program_client_set_env
- (sprog->program_client, "SENDER",
- smtp_address_encode(msgdata->envelope.mail_from));
+
+ sender = msgdata->envelope.mail_from;
+ recipient = msgdata->envelope.rcpt_to;
+ orig_recipient = NULL;
+ if ( msgdata->envelope.rcpt_params != NULL )
+ orig_recipient = msgdata->envelope.rcpt_params->orcpt.addr;
+
+ if ( !smtp_address_isnull(sender) ) {
+ program_client_set_env(sprog->program_client, "SENDER",
+ smtp_address_encode(sender));
}
- if ( !smtp_address_isnull(msgdata->envelope.rcpt_to) ) {
- program_client_set_env
- (sprog->program_client, "RECIPIENT",
- smtp_address_encode(msgdata->envelope.rcpt_to));
+ if ( !smtp_address_isnull(recipient) ) {
+ program_client_set_env(sprog->program_client, "RECIPIENT",
+ smtp_address_encode(recipient));
}
- if ( !smtp_address_isnull(msgdata->envelope.rcpt_params->orcpt.addr) ) {
- program_client_set_env
- (sprog->program_client, "ORIG_RECIPIENT",
- smtp_address_encode(msgdata->envelope.rcpt_params->orcpt.addr));
+ if ( !smtp_address_isnull(orig_recipient) ) {
+ program_client_set_env(sprog->program_client, "ORIG_RECIPIENT",
+ smtp_address_encode(orig_recipient));
}
return sprog;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Dec 25 18:47:35 UTC 2017 - mrueckert@suse.de
- backport 321a39be974deb2e7eff7b2a509a3ee6ff2e5ae1.patch
fixes crash with imap sieve
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Dec 24 02:04:25 UTC 2017 - mrueckert@suse.de Sun Dec 24 02:04:25 UTC 2017 - mrueckert@suse.de

View File

@ -133,6 +133,7 @@ Source8: dovecot-2.2-pigeonhole.configfiles
Source9: dovecot-2.3-pigeonhole.configfiles Source9: dovecot-2.3-pigeonhole.configfiles
Patch: dovecot-2.3.0-dont_use_etc_ssl_certs.patch Patch: dovecot-2.3.0-dont_use_etc_ssl_certs.patch
Patch1: dovecot-2.3.0-better_ssl_defaults.patch Patch1: dovecot-2.3.0-better_ssl_defaults.patch
Patch2: https://github.com/stephanbosch/pigeonhole-core/commit/321a39be974deb2e7eff7b2a509a3ee6ff2e5ae1.patch
Summary: IMAP and POP3 Server Written Primarily with Security in Mind Summary: IMAP and POP3 Server Written Primarily with Security in Mind
License: BSD-3-Clause and LGPL-2.1+ and MIT License: BSD-3-Clause and LGPL-2.1+ and MIT
Group: Productivity/Networking/Email/Servers Group: Productivity/Networking/Email/Servers
@ -312,6 +313,9 @@ dovecot tree.
%setup -q -n %{pkg_name}-ce-%{dovecot_version} -a 1 %setup -q -n %{pkg_name}-ce-%{dovecot_version} -a 1
%patch -p1 %patch -p1
%patch1 -p1 %patch1 -p1
pushd %{dovecot_pigeonhole_source_dir}
%patch2 -p1
popd
%{__gzip} -9v ChangeLog %{__gzip} -9v ChangeLog
# Fix plugins dir. # Fix plugins dir.
%{__sed} -i 's|#mail_plugin_dir = /usr/lib/dovecot|mail_plugin_dir = %{_libdir}/dovecot/modules|' doc/example-config/conf.d/10-mail.conf %{__sed} -i 's|#mail_plugin_dir = /usr/lib/dovecot|mail_plugin_dir = %{_libdir}/dovecot/modules|' doc/example-config/conf.d/10-mail.conf