diff --git a/src/lib-sieve/plugins/enotify/mailto/ntfy-mailto.c b/src/lib-sieve/plugins/enotify/mailto/ntfy-mailto.c
index 60e2a15496b107b1c1538a18c815e1ae39c53767..b0d59864450a6f6cb1e72ecf964c1620bd3c25ce 100644
--- a/src/lib-sieve/plugins/enotify/mailto/ntfy-mailto.c
+++ b/src/lib-sieve/plugins/enotify/mailto/ntfy-mailto.c
@@ -574,13 +574,12 @@ static int ntfy_mailto_send
 	rfc2822_header_write(msg, "Date", message_date_create(ioloop_time));
 	rfc2822_header_utf8_printf(msg, "Subject", "%s", subject);
 
-	rfc2822_header_utf8_printf(msg, "From", "%s", from);
+	rfc2822_header_write_address(msg, "From", from);
 
 	if ( to != NULL )
-		rfc2822_header_utf8_printf(msg, "To", "%s", str_c(to));
-
+		rfc2822_header_write_address(msg, "To", str_c(to));
 	if ( cc != NULL )
-		rfc2822_header_utf8_printf(msg, "Cc", "%s", str_c(cc));
+		rfc2822_header_write_address(msg, "Cc", str_c(cc));
 
 	rfc2822_header_printf(msg, "Auto-Submitted",
 		"auto-notified; owner-email=\"%s\"",
diff --git a/src/lib-sieve/plugins/notify/cmd-notify.c b/src/lib-sieve/plugins/notify/cmd-notify.c
index 02de65aa2ea0716430e93b7ce12d31bd5c644f9c..964fdecc785479a7bbe5fb3cd7cf175c8d4b4703 100644
--- a/src/lib-sieve/plugins/notify/cmd-notify.c
+++ b/src/lib-sieve/plugins/notify/cmd-notify.c
@@ -773,7 +773,7 @@ static bool act_notify_send
 		}
 	}
 
-	rfc2822_header_write(msg, "To", str_c(to));
+	rfc2822_header_write_address(msg, "To", str_c(to));
 
 	/* Generate message body */
 	str_printfa(msg, "\r\n%s\r\n", act->message);
diff --git a/src/lib-sieve/plugins/vacation/cmd-vacation.c b/src/lib-sieve/plugins/vacation/cmd-vacation.c
index acf698eec6c419737ef66bd185af7e758dc3cb93..7ef62ae3d3efea42d71ce529a6bd2e0cfa9ec762 100644
--- a/src/lib-sieve/plugins/vacation/cmd-vacation.c
+++ b/src/lib-sieve/plugins/vacation/cmd-vacation.c
@@ -1015,7 +1015,7 @@ static int act_vacation_send
 	rfc2822_header_write(msg, "Date", message_date_create(ioloop_time));
 
 	if ( ctx->from != NULL && *(ctx->from) != '\0' ) {
-		rfc2822_header_utf8_printf(msg, "From", "%s", ctx->from);
+		rfc2822_header_write_address(msg, "From", ctx->from);
 	} else {
 		if ( reply_from == NULL || reply_from->mailbox == NULL ||
 			*reply_from->mailbox == '\0' )
diff --git a/tests/extensions/enotify/mailto.svtest b/tests/extensions/enotify/mailto.svtest
index 82f47be845eb56a878ccef45c14fc1d9c845e9c6..e0d46b6c467d41d22c4bfe955a02871341a2991d 100644
--- a/tests/extensions/enotify/mailto.svtest
+++ b/tests/extensions/enotify/mailto.svtest
@@ -2,6 +2,7 @@ require "vnd.dovecot.testsuite";
 require "enotify";
 require "relational";
 require "envelope";
+require "variables";
 require "comparator-i;ascii-numeric";
 
 /*
@@ -483,3 +484,59 @@ test "Envelope config - user_email" {
 		test_fail "envelope recipient set incorrectly";
 	}
 }
+
+/*
+ * UTF-8 addresses
+ */
+
+test_result_reset;
+
+test_set "message" text:
+From: stephan@example.org
+To: nico@frop.example.org
+Subject: Frop!
+
+Klutsefluts.
+.
+;
+
+test "UTF-8 address" {
+	set "to" "=?utf-8?q?G=C3=BCnther?= M. Karotte <g.m.karotte@example.com>";
+	set "cc" "Dieter T. =?utf-8?q?Stoppelr=C3=BCbe?= <d.t.stoppelruebe@example.com>";
+
+	set :encodeurl "to_enc" "${to}";
+	set :encodeurl "cc_enc" "${cc}";
+
+	notify "mailto:?to=${to_enc}&cc=${cc_enc}";
+
+	if not test_result_execute {
+		test_fail "failed to execute notify";
+	}
+
+	test_message :smtp 0;
+	test_message_print;
+
+	set "expected" "Günther M. Karotte <g.m.karotte@example.com>";
+	if not header :is "to" "${expected}" {
+		if header :matches "to" "*" { set "decoded" "${1}"; }
+
+		test_fail text:
+to header is not encoded/decoded properly:
+expected: ${expected}
+decoded: ${decoded}
+.
+;
+	}
+
+	set "expected" "Dieter T. Stoppelrübe <d.t.stoppelruebe@example.com>";
+	if not header :is "cc" "${expected}" {
+		if header :matches "cc" "*" { set "decoded" "${1}"; }
+
+		test_fail text:
+to header is not encoded/decoded properly:
+expected: ${expected}
+decoded: ${decoded}
+.
+;
+	}
+}
diff --git a/tests/extensions/vacation/utf-8.svtest b/tests/extensions/vacation/utf-8.svtest
index 6697849f12d7ad3d98e89cb2e99e917cf16f0e00..e94f7b9b84ee1e11087c1613e9be5b92fd855f77 100644
--- a/tests/extensions/vacation/utf-8.svtest
+++ b/tests/extensions/vacation/utf-8.svtest
@@ -84,3 +84,85 @@ decoded: ${subject}
 ;
 	}
 }
+
+test_result_reset;
+
+test_set "message" text:
+From: stephan@example.org
+Subject: frop
+Message-ID: <432df324@example.org>
+To: <g.m.karotte@example.com>
+
+Frop
+.
+;
+
+
+test "MIME Encoded From" {
+	vacation :subject "Frop"
+		:from "=?utf-8?q?G=C3=BCnther?= M. Karotte <g.m.karotte@example.com>"
+		"I am not in today";
+
+	/* Execute Sieve result (sending message to dummy SMTP) */
+	if not test_result_execute {
+		test_fail "execution of result failed";
+	}
+
+	/* Retrieve message from dummy SMTP and set it as the active message under
+	 * test.
+	 */
+	test_message :smtp 0;
+
+	set "expected" "Günther M. Karotte <g.m.karotte@example.com>";
+	if not header :is "from" "${expected}" {
+		if header :matches "from" "*" { set "decoded" "${1}"; }
+
+		test_fail text:
+from header is not encoded/decoded properly:
+expected: ${expected}
+decoded: ${decoded}
+.
+;
+	}
+}
+
+test_result_reset;
+
+test_set "message" text:
+From: stephan@example.org
+Subject: frop
+Message-ID: <432df324@example.org>
+To: <g.m.karotte@example.com>
+
+Frop
+.
+;
+
+
+test "MIME Encoded From - UTF-8 in phrase" {
+	vacation :subject "Frop"
+		:from "Günther M. Karotte <g.m.karotte@example.com>"
+		"I am not in today";
+
+	/* Execute Sieve result (sending message to dummy SMTP) */
+	if not test_result_execute {
+		test_fail "execution of result failed";
+	}
+
+	/* Retrieve message from dummy SMTP and set it as the active message under
+	 * test.
+	 */
+	test_message :smtp 0;
+
+	set "expected" "Günther M. Karotte <g.m.karotte@example.com>";
+	if not header :is "from" "${expected}" {
+		if header :matches "from" "*" { set "decoded" "${1}"; }
+
+		test_fail text:
+from header is not encoded/decoded properly:
+expected: ${expected}
+decoded: ${decoded}
+.
+;
+	}
+}