Case Sensitivity

Henrique de Moraes Holschuh hmh at debian.org
Mon Dec 23 17:20:17 EST 2002


On Mon, 23 Dec 2002, Amos Gouaux wrote:
> When the discussion came up on postfix-users after some folks found
> this problematic, it was decided that it was wrong of the lmtp
> client to forcibly downcase everything.  Now we run into this fun.  

Bleh. They should have added an option so that we can tell it to lowercase
stuff :(

> I wonder, perhaps there could be a switch to the Cyrus lmtp server
> to downcase stuff?  Maybe I'm wrong, but it seems like this is logic

See the attached, untested patch. I will send it to CMU after testing it.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
-------------- next part --------------
Index: imap/lmtpengine.c
===================================================================
RCS file: /home/cvs/debian/cyrus21-imapd/imap/lmtpengine.c,v
retrieving revision 1.17
diff -u -r1.17 lmtpengine.c
--- imap/lmtpengine.c	15 Nov 2002 00:24:28 -0000	1.17
+++ imap/lmtpengine.c	23 Dec 2002 22:11:54 -0000
@@ -1116,9 +1116,12 @@
     int r, sl;
     address_data_t *ret = (address_data_t *) xmalloc(sizeof(address_data_t));
     char lmtpeolat;
+    int forcedowncase;
 
     assert(addr != NULL && msg != NULL);
 
+    forcedowncase = config_getswitch("lmtp_downcase_rcpt", 0);
+
     /* disgusting hack to allow foo at bar.org users */
     lmtpeolat = config_getswitch("robot101mode",0) ? '\0' : '@';
 
@@ -1154,11 +1157,12 @@
     else {
 	while (*addr != lmtpeolat && *addr != '>') {
 	    if (*addr == '\\') addr++;
-	    *dest++ = *addr++;
+	    if (! forcedowncase) *dest++ = *addr++;
+	    else *dest++ = TOLOWER(*addr++);
 	}
     }
     *dest = '\0';
-	
+
     r = verify_user(user, ignorequota ? -1 : msg->size, msg->authstate);
     if (r) {
 	/* we lost */
Index: man/imapd.conf.5
===================================================================
RCS file: /home/cvs/debian/cyrus21-imapd/man/imapd.conf.5,v
retrieving revision 1.18
diff -u -r1.18 imapd.conf.5
--- man/imapd.conf.5	25 Nov 2002 21:16:21 -0000	1.18
+++ man/imapd.conf.5	23 Dec 2002 22:14:53 -0000
@@ -235,6 +235,9 @@
 mailbox is over quota.  By default, the failure is temporary.
 .IP "\fBlmtp_allowplaintext:\fR <setting of \fIallowplaintext\fR>" 5
 Allow the use of the SASL PLAIN mechanism for LMTP.
+.IP "\fBlmtp_downcase_rcpt:\fR no" 5
+If enabled, lmtpd will convert the entire recipient address to lowercase,
+including any address extensions "+folder".
 .IP "\fBpostuser:\fR <none>" 5
 Userid used to deliver messages to shared folders.  For example, if
 set to "bb", email sent to "bb+shared.blah" would be delivered to the


More information about the Info-cyrus mailing list