cf58a5c
diff -Naur cyrus-imapd-2.2.12/doc/man/deliver.8.html cyrus-imapd-2.2.12.munge8bit/doc/man/deliver.8.html
cf58a5c
--- cyrus-imapd-2.2.12/doc/man/deliver.8.html	2005-02-14 19:02:17.000000000 +0100
cf58a5c
+++ cyrus-imapd-2.2.12.munge8bit/doc/man/deliver.8.html	2005-06-18 19:02:39.000000000 +0200
cf58a5c
@@ -223,13 +223,15 @@
d0d307a
 
d0d307a
 
d0d307a
 

Depending on the setting of reject8bit in

d0d307a
-imapd.conf(5), deliver either rejects messages with
d0d307a
-8-bit-set characters in the headers or changes these
d0d307a
-characters to ‘X’. This is because such
d0d307a
-characters can’t be interpreted since the character
d0d307a
-set is not known, although some communities not well-served
d0d307a
-by US-ASCII assume that those characters can be used to
d0d307a
-represent characters not present in US-ASCII.

d0d307a
+imapd.conf(5), deliver either rejects/accepts
d0d307a
+messages with 8-bit-set characters in the headers. If we
d0d307a
+accept messages with 8-bit-set characters in the headers,
d0d307a
+then depending on the setting of munge8bit, these
cf58a5c
+characters are either left un-touched or changed to ‘X’. This
d0d307a
+is because such characters can’t be interpreted since
d0d307a
+the character set is not known, although some communities
d0d307a
+not well-served by US-ASCII assume that those characters can
d0d307a
+be used to represent characters not present in US-ASCII.

d0d307a
 
d0d307a
 

A method for encoding 8-bit-set characters is provided by

d0d307a
 RFC 2047.

cf58a5c
diff -Naur cyrus-imapd-2.2.12/doc/man/imapd.conf.5.html cyrus-imapd-2.2.12.munge8bit/doc/man/imapd.conf.5.html
cf58a5c
--- cyrus-imapd-2.2.12/doc/man/imapd.conf.5.html	2005-02-14 19:02:18.000000000 +0100
cf58a5c
+++ cyrus-imapd-2.2.12.munge8bit/doc/man/imapd.conf.5.html	2005-06-18 18:59:46.000000000 +0200
cf58a5c
@@ -2562,7 +2562,7 @@
cf58a5c
 
cf58a5c
 

If enabled, lmtpd rejects messages with 8-bit characters

cf58a5c
 in the headers. Otherwise, 8-bit characters are changed to
cf58a5c
-‘X’. (A proper soultion to non-ASCII characters
cf58a5c
+‘X’. (A proper solution to non-ASCII characters
cf58a5c
 in headers is offered by RFC 2047 and its predecessors.)

cf58a5c
 
cf58a5c
 
cf58a5c
diff -Naur cyrus-imapd-2.2.12/imap/message.c cyrus-imapd-2.2.12.munge8bit/imap/message.c
cf58a5c
--- cyrus-imapd-2.2.12/imap/message.c	2004-09-16 19:58:54.000000000 +0200
cf58a5c
+++ cyrus-imapd-2.2.12.munge8bit/imap/message.c	2005-06-18 18:58:33.000000000 +0200
d0d307a
@@ -227,6 +227,7 @@
d0d307a
     int n;
d0d307a
     int sawcr = 0, sawnl;
d0d307a
     int reject8bit = config_getswitch(IMAPOPT_REJECT8BIT);
d0d307a
+    int munge8bit = config_getswitch(IMAPOPT_MUNGE8BIT);
d0d307a
     int inheader = 1, blankline = 1;
d0d307a
 
d0d307a
     while (size) {
d0d307a
@@ -262,7 +263,7 @@
d0d307a
 			/* We have been configured to reject all mail of this
d0d307a
 			   form. */
d0d307a
 			if (!r) r = IMAP_MESSAGE_CONTAINS8BIT;
d0d307a
-		    } else {
d0d307a
+		    } else if (munge8bit) {
d0d307a
 			/* We have been configured to munge all mail of this
d0d307a
 			   form. */
d0d307a
 			*p = 'X';
cf58a5c
diff -Naur cyrus-imapd-2.2.12/imap/spool.c cyrus-imapd-2.2.12.munge8bit/imap/spool.c
cf58a5c
--- cyrus-imapd-2.2.12/imap/spool.c	2004-10-27 22:40:50.000000000 +0200
cf58a5c
+++ cyrus-imapd-2.2.12.munge8bit/imap/spool.c	2005-06-18 18:58:33.000000000 +0200
d0d307a
@@ -140,6 +140,7 @@
d0d307a
     state s = NAME_START;
d0d307a
     int r = 0;
d0d307a
     int reject8bit = config_getswitch(IMAPOPT_REJECT8BIT);
d0d307a
+    int munge8bit = config_getswitch(IMAPOPT_MUNGE8BIT);
d0d307a
     const char **skip = NULL;
d0d307a
 
d0d307a
     if (namelen == 0) {
d0d307a
@@ -266,7 +267,7 @@
d0d307a
 			   form. */
d0d307a
 			r = IMAP_MESSAGE_CONTAINS8BIT;
d0d307a
 			goto ph_error;
d0d307a
-		    } else {
d0d307a
+		    } else if (munge8bit) {
d0d307a
 			/* We have been configured to munge all mail of this
d0d307a
 			   form. */
d0d307a
 			c = 'X';
cf58a5c
diff -Naur cyrus-imapd-2.2.12/lib/imapoptions cyrus-imapd-2.2.12.munge8bit/lib/imapoptions
cf58a5c
--- cyrus-imapd-2.2.12/lib/imapoptions	2004-07-21 21:07:45.000000000 +0200
cf58a5c
+++ cyrus-imapd-2.2.12.munge8bit/lib/imapoptions	2005-06-18 18:58:33.000000000 +0200
cf58a5c
@@ -458,6 +458,12 @@
d0d307a
 { "mboxlist_db", "skiplist", STRINGLIST("flat", "berkeley", "skiplist")}
d0d307a
 /* The cyrusdb backend to use for the mailbox list. */
d0d307a
 
d0d307a
+{ "munge8bit", 1, SWITCH }
d0d307a
+/* If enabled, lmtpd munges messages with 8-bit characters.  These characters
cf58a5c
+   are changed to `X'.  If \fBreject8bit\fR is enabled, setting \fBmunge8bit\fR
cf58a5c
+   has no effect.  (A proper solution to non-ASCII characters in headers is
d0d307a
+   offered by RFC 2047 and its predecessors.) */
d0d307a
+
d0d307a
 # xxx badly worded
d0d307a
 { "mupdate_connections_max", 128, INT }
d0d307a
 /* The max number of connections that a mupdate process will allow, this
cf58a5c
@@ -670,9 +676,7 @@
d0d307a
 
d0d307a
 { "reject8bit", 0, SWITCH }
d0d307a
 /* If enabled, lmtpd rejects messages with 8-bit characters in the
d0d307a
-   headers.  Otherwise, 8-bit characters are changed to `X'.  (A
d0d307a
-   proper soultion to non-ASCII characters in headers is offered by  
d0d307a
-   RFC 2047 and its predecessors.) */
d0d307a
+   headers. */
d0d307a
 
d0d307a
 { "rfc2046_strict", 0, SWITCH }
d0d307a
 /* If enabled, imapd will be strict (per RFC 2046) when matching MIME
cf58a5c
diff -Naur cyrus-imapd-2.2.12/man/deliver.8 cyrus-imapd-2.2.12.munge8bit/man/deliver.8
cf58a5c
--- cyrus-imapd-2.2.12/man/deliver.8	2004-06-21 20:40:10.000000000 +0200
cf58a5c
+++ cyrus-imapd-2.2.12.munge8bit/man/deliver.8	2005-06-18 18:58:33.000000000 +0200
d0d307a
@@ -147,8 +147,10 @@
d0d307a
 Accept messages using the LMTP protocol.
d0d307a
 .SH NOTES
d0d307a
 Depending on the setting of \fBreject8bit\fR in \fBimapd.conf(5)\fR, deliver
d0d307a
-either rejects messages with 8-bit-set characters in the headers or 
d0d307a
-changes these characters to `X'.
d0d307a
+either rejects/accepts messages with 8-bit-set characters in the headers.
d0d307a
+If we accept messages with 8-bit-set characters in the headers, then depending
d0d307a
+on the setting of \fBmunge8bit\fR, these characters are either left un-touched
d0d307a
+or changed to .
d0d307a
 This is because such characters can't be interpreted since the
d0d307a
 character set is not known, although some communities not well-served by
d0d307a
 US-ASCII assume that those characters can be used to represent characters not
cf58a5c
diff -Naur cyrus-imapd-2.2.12/man/imapd.conf.5 cyrus-imapd-2.2.12.munge8bit/man/imapd.conf.5
cf58a5c
--- cyrus-imapd-2.2.12/man/imapd.conf.5	2005-02-14 19:02:16.000000000 +0100
cf58a5c
+++ cyrus-imapd-2.2.12.munge8bit/man/imapd.conf.5	2005-06-18 18:59:08.000000000 +0200
cf58a5c
@@ -551,7 +551,7 @@
cf58a5c
 .IP "\fBreject8bit:\fR 0" 5
cf58a5c
 If enabled, lmtpd rejects messages with 8-bit characters in the
cf58a5c
 headers.  Otherwise, 8-bit characters are changed to `X'.  (A
cf58a5c
-proper soultion to non-ASCII characters in headers is offered by  
cf58a5c
+proper solution to non-ASCII characters in headers is offered by  
cf58a5c
 RFC 2047 and its predecessors.) 
cf58a5c
 .IP "\fBrfc2046_strict:\fR 0" 5
cf58a5c
 If enabled, imapd will be strict (per RFC 2046) when matching MIME