[dovecot-cvs] dovecot/src/deliver mail-send.c,1.1.2.2,1.1.2.3

tss at dovecot.org tss at dovecot.org
Thu Nov 2 20:53:48 UTC 2006


Update of /var/lib/cvs/dovecot/src/deliver
In directory talvi:/tmp/cvs-serv8270

Modified Files:
      Tag: branch_1_0
	mail-send.c 
Log Message:
When sending rejects, don't include Content-Type in the rejected mail's
headers.



Index: mail-send.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/deliver/mail-send.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- mail-send.c	8 Oct 2006 20:09:47 -0000	1.1.2.2
+++ mail-send.c	2 Nov 2006 20:53:46 -0000	1.1.2.3
@@ -95,8 +95,20 @@
 
     input = mail_get_stream(mail, &hdr_size, NULL);
     if (input != NULL) {
-	    input = i_stream_create_limit(default_pool, input,
-					  0, hdr_size.physical_size);
+	    /* Note: If you add more headers, they need to be sorted.
+	       We'll drop Content-Type because we're not including the message
+	       body, and having a multipart Content-Type may confuse some
+	       MIME parsers when they don't see the message boundaries. */
+	    static const char *const exclude_headers[] = {
+		    "Content-Type"
+	    };
+
+	    input = i_stream_create_header_filter(input,
+	    		HEADER_FILTER_EXCLUDE | HEADER_FILTER_NO_CR |
+			HEADER_FILTER_HIDE_BODY, exclude_headers,
+			sizeof(exclude_headers) / sizeof(exclude_headers[0]),
+			NULL, NULL);
+
 	    while ((ret = i_stream_read_data(input, &data, &size, 0)) > 0) {
 		    fwrite(data, size, 1, f);
 		    i_stream_skip(input, size);



More information about the dovecot-cvs mailing list