Here is a little patch that allows for use of the  "%" (percent),
or ":" (colon) chars as separators for the [EMAIL PROTECTED] problem
for Netscape Messenger clients in a virtual domain(s) environment.

--- authmysqllib.c-save Thu Jan 17 11:41:41 2002
+++ authmysqllib.c      Thu Jan 17 16:06:46 2002
@@ -191,10 +191,13 @@
 static void append_username(char *p, const char *username,
                            const char *defdomain)
 {
-       for (strcpy(p, username); *p; p++)
+       for (strcpy(p, username); *p; p++) 
                if (*p == '"' || *p == '\\' ||
                    (int)(unsigned char)*p < ' ')
                        *p=' '; /* No funny business */
+
+       if (strchr(username, ':') != 0) return;
+       if (strchr(username, '%') != 0) return; 
        if (strchr(username, '@') == 0 && defdomain && *defdomain)
                strcat(strcpy(p, "@"), defdomain);
 }

I have MySQL passwd table entries that contain entries for:

[EMAIL PROTECTED],   user2%somedomain.com, user3:somedomain.com  and
localuser (with no @defaultdomain) all work properly.

The Netscape Messenger clients enter their e-mail account names with
either a ":" (colon) or "%" (percent) in place of a "@" (at sign)
but, of course, list their real e-mail address in the proper location
so that folks can replay to them, etc.

As delivered, authmysqllib.c would discover the missing "@" and assume
that it was a username for the 'DEFAULT_DOMAIN" (see authmysqlrc).

The patch (above) simply checks for the existence of either alternate
separator, and accepts it as a good username. It works equally well
for POP3 and IMAP (as you would expect). I have *not* even looked
at the authpgsqllib.c instance of this; but the idea is the same...




Randy Lewis

_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to