diff --git a/src/lib-sieve/cmd-redirect.c b/src/lib-sieve/cmd-redirect.c
index 1faa3c888316abab0e266d331a05070f6c4c116d..d3a63a81145eadead7446c20919c9c8a8b09cb6f 100644
--- a/src/lib-sieve/cmd-redirect.c
+++ b/src/lib-sieve/cmd-redirect.c
@@ -282,7 +282,7 @@ static bool act_redirect_send
 
 	const struct sieve_message_data *msgdata = aenv->msgdata;
 	const struct sieve_script_env *senv = aenv->scriptenv;
-	struct istream *input;
+	struct istream *input, *crlf_input;
 	void *smtp_handle;
 	FILE *f;
 	const unsigned char *data;
@@ -303,18 +303,23 @@ static bool act_redirect_send
 
 	/* Remove unwanted headers */
 	input = i_stream_create_header_filter
-		(input, HEADER_FILTER_EXCLUDE | HEADER_FILTER_NO_CR, hide_headers,
+		(input, HEADER_FILTER_EXCLUDE, hide_headers,
 			N_ELEMENTS(hide_headers), null_header_filter_callback, NULL);
+	
+	/* Make sure the message contains CRLF consistently */
+	crlf_input = i_stream_create_crlf(input);
 
 	/* Prepend sieve version header (should not affect signatures) */
 	rfc2822_header_field_write(f, "X-Sieve", SIEVE_IMPLEMENTATION);
 
 	/* Pipe the message to the outgoing SMTP transport */
-	while ((ret = i_stream_read_data(input, &data, &size, 0)) > 0) {	
+	while ((ret = i_stream_read_data(crlf_input, &data, &size, 0)) > 0) {	
 		if (fwrite(data, size, 1, f) == 0)
 			break;
-		i_stream_skip(input, size);
+		i_stream_skip(crlf_input, size);
 	}
+
+	i_stream_unref(&crlf_input);
 	i_stream_unref(&input);
 
 	/* Close SMTP transport */
diff --git a/src/lib-sieve/rfc2822.c b/src/lib-sieve/rfc2822.c
index 803794fccdadbcc4fe4be043d5458d6ab6eb800c..c2fa06a5a17e78e26192aab3d459c00ec37e814d 100644
--- a/src/lib-sieve/rfc2822.c
+++ b/src/lib-sieve/rfc2822.c
@@ -149,15 +149,15 @@ void rfc2822_header_field_write
 			fwrite(sp, nlp-sp, 1, f);
 			
 			if ( *bp != '\0' && *bp != ' ' && *bp != '\t' )
-				fwrite("\n\t", 2, 1, f);
+				fwrite("\r\n\t", 3, 1, f);
 			else
-				fwrite("\n", 1, 1, f);
+				fwrite("\r\n", 2, 1, f);
 				
 			sp = bp;
 		} else {
 			/* Insert newline at last whitespace within the max_line limit */
 			fwrite(sp, wp-sp, 1, f);
-			fwrite("\n", 1, 1, f);
+			fwrite("\r\n", 2, 1, f);
 			sp = wp;
 		}
 		
@@ -168,7 +168,7 @@ void rfc2822_header_field_write
 	
 	if ( bp != sp ) {
 		fwrite(sp, bp-sp, 1, f);
-		fwrite("\n", 1, 1, f);
+		fwrite("\r\n", 2, 1, f);
 	}
 }