I'm currently using the patch on a small (5 user) system running Cyrus 2.0.12. I've not had any problems since I created and applied the patch, but I'm only one person... I have made some small changes. The latest patches are attached to this message. If there are any problems, please let me know right away! I plan to use the patched version of Cyrus for a large ISP I work for, however I'd like some input from other users first. -David Fuchs Allan Rafuse wrote: > Does anyone have any comments on this patch. Does it work > well, any problems. Also, will it work with 2..0.12? > > -Allan > > On Wed, 14 Feb 2001 14:47:52 -0800, David Fuchs wrote: > > >> Attached are two patch-files that will change the Netnews dot delimiter >> to a slash in Cyrus. I created these patches from the sources for >> 2.0.11 (you shouldn't need 2.0.11 to apply it though). The first file >> (imappatch) needs to be run in the IMAP directory of the Cyrus sources. >> The second file (libpatch) needs to be run in the lib directory of the >> Cyrus sources. >> >> User mailboxes will act differently with the patch applied. Dots are >> now allowed in usernames, but not slashes. >> >> Example of a mailbox listing: >> >> cyradm> lm >> user/david.fuchs >> user/david.fuchs/subfolder >> >> I've tested this patch with Microsoft Outlook Express and Pine as mail >> clients (POP3 and IMAP). Everything seems to work fine. I'm not a >> professional developer, so if there are any problems please mail me. >> >> -David Fuchs >> >> /* The sender intends this message for a specific recipient and, as it >> may contain information that is privileged or confidential, any use, >> dissemination, forwarding, or copying by anyone without permission from >> the sender is prohibited. Personal e-mail may contain views that are >> not necessarily those of the company. */ >> > > > > <- Allan Rafuse -> > Systems Administrator > Freeview Publishing Inc. > email: [EMAIL PROTECTED] > web: http://www.freeview.com
--- acapmbox.c Tue Dec 26 13:35:40 2000 +++ acapmbox.c Wed Feb 14 10:55:31 2001 @@ -93,12 +93,12 @@ const char *server, const char *name) { if (!server) server = config_servername; - if (!strncmp(name, "user.", 5)) { + if (!strncmp(name, "user/", 5)) { char *p; /* user+detail */ strcpy(postaddr, name + 5); - p = strchr(postaddr, '.'); + p = strchr(postaddr, '/'); if (p) *p = '+'; strcat(postaddr, "@"); strcat(postaddr, server); @@ -267,7 +267,7 @@ strcpy(ret, entryname + gdlen + 1); for (j = 0; ret[j] != '\0'; j++) { - if (ret[j] == '/') ret[j] = '.'; + if (ret[j] == '.') ret[j] = '/'; } return 0; --- arbitron.c Thu Feb 8 13:55:07 2001 +++ arbitron.c Thu Feb 8 13:55:48 2001 @@ -162,10 +162,10 @@ int useridlen = tab - line; /* Don't report users reading their own private mailboxes */ - if (!strncasecmp(arbitronargs->name, "user.", 5) && - !memchr(line, '.', useridlen) && + if (!strncasecmp(arbitronargs->name, "user/", 5) && + !memchr(line, '/', useridlen) && !strncasecmp(arbitronargs->name+5, line, useridlen) && - (arbitronargs->name[5+useridlen] == '.' || + (arbitronargs->name[5+useridlen] == '/' || arbitronargs->name[5+useridlen] == '\0')) { return 0; } @@ -201,7 +201,7 @@ if (!r) { if (arbitronargs.read_count || - strncasecmp(name, "user.", 5) != 0) { + strncasecmp(name, "user/", 5) != 0) { printf("%u %s\n", arbitronargs.read_count, name); } } --- duplicate.c Thu Feb 8 13:55:13 2001 +++ duplicate.c Thu Feb 8 13:55:33 2001 @@ -160,11 +160,11 @@ char *idx; char c; - idx = strchr(mbox,'.'); /* skip past user. */ - if (idx == NULL) { /* no '.' so just use mbox */ + idx = strchr(mbox,'/'); /* skip past user/ */ + if (idx == NULL) { /* no '/' so just use mbox */ idx = mbox; } else { - idx++; /* skip past '.' */ + idx++; /* skip past '/' */ } c = (char) tolower((int) *idx); if (!islower((int) c)) { --- idle_idled.c Tue Feb 13 10:36:44 2001 +++ idle_idled.c Tue Feb 13 10:36:53 2001 @@ -190,7 +190,7 @@ /* fill the structure */ idledata.msg = msg; idledata.pid = getpid(); - strcpy(idledata.mboxname, mailbox ? mailbox->name : "."); + strcpy(idledata.mboxname, mailbox ? mailbox->name : "/"); /* send */ if (sendto(notify_sock, (void *) &idledata, --- imapd.c Thu Feb 8 13:43:40 2001 +++ imapd.c Tue Feb 13 10:54:44 2001 @@ -233,9 +233,9 @@ int r; struct auth_state *authstate; - if (strchr(user, '.') || strlen(user)+6 >= sizeof(inboxname)) return 0; + if (strchr(user, '/') || strlen(user)+6 >= sizeof(inboxname)) return 0; - strcpy(inboxname, "user."); + strcpy(inboxname, "user/"); strcat(inboxname, user); if (!(authstate = auth_newstate(auth_identity, (char *)0)) || @@ -2355,7 +2355,6 @@ int fetchedsomething; memset(&fetchargs, 0, sizeof(struct fetchargs)); - c = getword(&fetchatt); if (c == '(' && !fetchatt.s[0]) { inlist = 1; @@ -3232,7 +3231,7 @@ r = IMAP_PERMISSION_DENIED; } - if (name[0] && name[strlen(name)-1] == '.') { + if (name[0] && name[strlen(name)-1] == '/') { /* We don't care about trailing hierarchy delimiters. */ name[strlen(name)-1] = '\0'; } @@ -3245,7 +3244,6 @@ r = mboxlist_createmailbox(mailboxname, 0, partition, imapd_userisadmin, imapd_userid, imapd_authstate); - if (r == IMAP_PERMISSION_DENIED && !strcasecmp(name, "INBOX") && (autocreatequota = config_getint("autocreatequota", 0))) { @@ -3318,7 +3316,7 @@ } /* was it a top-level user mailbox? */ - if (!r && !strncmp(name, "user.", 5) && !strchr(name+5, '.')) { + if (!r && !strncmp(name, "user/", 5) && !strchr(name+5, '/')) { struct tmplist *l = xmalloc(sizeof(struct tmplist)); int r2, i; @@ -3389,12 +3387,12 @@ nmlen = strlen(newmailboxname); if (strlen(oldmailboxname) < strlen(newmailboxname)) { if (!strncmp(oldmailboxname, newmailboxname, omlen) && - newmailboxname[omlen] == '.') { + newmailboxname[omlen] == '/') { recursive_rename = 0; } } else { if (!strncmp(oldmailboxname, newmailboxname, nmlen) && - oldmailboxname[nmlen] == '.') { + oldmailboxname[nmlen] == '/') { recursive_rename = 0; } } @@ -3525,10 +3523,10 @@ if (!pattern[0] && !subscribed) { /* Special case: query top-level hierarchy separator */ - prot_printf(imapd_out, "* LIST (\\Noselect) \".\" \"\"\r\n"); + prot_printf(imapd_out, "* LIST (\\Noselect) \"/\" \"\"\r\n"); } else { /* Do we need to concatenate fields? */ - if (!ignorereference || pattern[0] == '.') { + if (!ignorereference || pattern[0] == '/') { /* Either * - name begins with dot * - we're configured to honor the reference argument */ @@ -3543,7 +3541,7 @@ if (*reference) { /* check for LIST A. .B, change to LIST "" A.B */ - if (reference[reflen-1] == '.' && pattern[0] == '.') { + if (reference[reflen-1] == '/' && pattern[0] == '/') { reference[--reflen] = '\0'; } strcpy(buf, reference); @@ -3728,11 +3726,11 @@ if (!canon_identifier) { rightsdesc = "\"\""; } - else if (!strncmp(mailboxname, "user.", 5) && - !strchr(canon_identifier, '.') && + else if (!strncmp(mailboxname, "user/", 5) && + !strchr(canon_identifier, '/') && !strncmp(mailboxname+5, canon_identifier, canonidlen) && (mailboxname[5+canonidlen] == '\0' || - mailboxname[5+canonidlen] == '.')) { + mailboxname[5+canonidlen] == '/')) { rightsdesc = "lca r s w i p d 0 1 2 3 4 5 6 7 8 9"; } else { @@ -4273,10 +4271,10 @@ return 0; } - if (!(strncmp(name, "INBOX.", 6))) { + if (!(strncmp(name, "INBOX/", 6))) { /* The user has a "personal" namespace. */ sawone[NAMESPACE_INBOX] = 1; - } else if (!(strncmp(name, "user.", 5))) { + } else if (!(strncmp(name, "user/", 5))) { /* The user can see the "other users" namespace. */ sawone[NAMESPACE_USER] = 1; } else { @@ -4310,9 +4308,9 @@ } prot_printf(imapd_out, "* NAMESPACE %s %s %s\r\n", - (sawone[NAMESPACE_INBOX]) ? "((\"INBOX.\" \".\"))" : "NIL", - (sawone[NAMESPACE_USER]) ? "((\"user.\" \".\"))" : "NIL", - (sawone[NAMESPACE_SHARED]) ? "((\"\" \".\"))" : "NIL"); + (sawone[NAMESPACE_INBOX]) ? "((\"INBOX/\" \"/\"))" : "NIL", + (sawone[NAMESPACE_USER]) ? "((\"user/\" \"/\"))" : "NIL", + (sawone[NAMESPACE_SHARED]) ? "((\"\" \"/\"))" : "NIL"); prot_printf(imapd_out, "%s OK %s\r\n", tag, error_message(IMAP_OK_COMPLETED)); @@ -5638,10 +5636,10 @@ if (lastnamedelayed) { if (name && strncmp(lastname, name, strlen(lastname)) == 0 && - name[strlen(lastname)] == '.') { + name[strlen(lastname)] == '/') { lastnamehassub = 1; } - prot_printf(imapd_out, "* %s (%s) \".\" ", cmd, + prot_printf(imapd_out, "* %s (%s) \"/\" ", cmd, lastnamehassub ? "" : "\\Noinferiors"); printastring(lastname); prot_printf(imapd_out, "\r\n"); @@ -5678,7 +5676,7 @@ c = name[matchlen]; if (c) name[matchlen] = '\0'; - prot_printf(imapd_out, "* %s (%s) \".\" ", cmd, c ? "\\Noselect" : ""); + prot_printf(imapd_out, "* %s (%s) \"/\" ", cmd, c ? "\\Noselect" : ""); printstring(name); prot_printf(imapd_out, "\r\n"); if (c) name[matchlen] = c; --- ipurge.c Thu Feb 8 13:43:50 2001 +++ ipurge.c Thu Feb 8 13:44:42 2001 @@ -182,8 +182,8 @@ int error; mbox_stats_t stats; - /* DON'T purge INBOX* and user.* */ - if ((strncasecmp(name,"INBOX",5)==0) || (strncasecmp(name,"user.",5)==0)) + /* DON'T purge INBOX* and user/* */ + if ((strncasecmp(name,"INBOX",5)==0) || (strncasecmp(name,"user/",5)==0)) return 0; memset(&stats, '\0', sizeof(mbox_stats_t)); --- lmtpd.c Thu Feb 8 13:49:30 2001 +++ lmtpd.c Tue Feb 13 13:43:01 2001 @@ -343,7 +343,7 @@ { static char buf[MAX_MAILBOX_PATH]; - buf[0] = '.'; + buf[0] = '/'; buf[1] = '\0'; strcat(buf, user); strcat(buf, ".sieve."); @@ -1100,17 +1100,16 @@ if (user && !strncasecmp(mailboxname, "INBOX", 5)) { /* canonicalize mailbox */ - if (strchr(user, '.') || + if (strchr(user, '/') || strlen(user) + 30 > MAX_MAILBOX_PATH) { return IMAP_MAILBOX_NONEXISTENT; } - strcpy(namebuf, "user."); + strcpy(namebuf, "user/"); strcat(namebuf, user); strcat(namebuf, mailboxname + 5); } else { strcpy(namebuf, mailboxname); } - if (dupelim && id && duplicate_check(id, strlen(id), namebuf, strlen(namebuf))) { /* duplicate message */ @@ -1135,7 +1134,7 @@ } if (!r && user) { - /* do we want to replace user.XXX with INBOX? */ + /* do we want to replace user/XXX with INBOX? */ notify("MAIL", mailboxname, user, mailboxname, notifyheader ? notifyheader : ""); } @@ -1185,7 +1184,7 @@ } /* case 2: ordinary user, might have Sieve script */ - else if (!strchr(rcpt, '.') && + else if (!strchr(rcpt, '/') && strlen(rcpt) + 30 <= MAX_MAILBOX_PATH) { FILE *f = sieve_find_script(rcpt); char namebuf[MAX_MAILBOX_PATH]; @@ -1346,7 +1345,7 @@ if (strlen(user) > sizeof(buf)-10) { r = IMAP_MAILBOX_NONEXISTENT; } else { - strcpy(buf, "user."); + strcpy(buf, "user/"); strcat(buf, user); plus = strchr(buf, '+'); if (plus) *plus = '\0'; --- lmtpproxyd.c Thu Feb 8 13:48:49 2001 +++ lmtpproxyd.c Thu Feb 8 13:49:15 2001 @@ -695,7 +695,7 @@ if (sd->username && !strncasecmp(mailboxname, "INBOX", 5)) { /* canonicalize mailbox */ snprintf(namebuf, sizeof namebuf, - "%s+user.%s%s", BB, sd->username, mailboxname + 5); + "%s+user/%s%s", BB, sd->username, mailboxname + 5); } else { snprintf(namebuf, sizeof namebuf, "%s+%s", BB, mailboxname); } @@ -1090,7 +1090,7 @@ char buf[MAX_MAILBOX_NAME]; char *plus; - strlcpy(buf, "user.", sizeof buf); + strlcpy(buf, "user/", sizeof buf); strlcat(buf, mailbox, sizeof buf); plus = strchr(buf, '+'); if (plus) *plus = '\0'; @@ -1435,7 +1435,7 @@ r = IMAP_MAILBOX_NONEXISTENT; } else { /* just copy before the plus */ - strcpy(buf, "user."); + strcpy(buf, "user/"); strncat(buf, user, l); buf[l + 5] = '\0'; r = mboxlist_lookup(buf, NULL, NULL, NULL); --- mailbox.c Thu Feb 8 13:36:13 2001 +++ mailbox.c Tue Feb 13 13:44:11 2001 @@ -1245,7 +1245,6 @@ assert(quota->lock_count != 0); if (!quota->root) return 0; - mailbox_hash_quota(quota_path, quota->root); strcpy(new_quota_path, quota_path); strcat(new_quota_path, ".NEW"); @@ -1845,7 +1844,7 @@ mailbox_hash_quota(quota_path, start); while (stat(quota_path, &sbuf) == -1) { - tail = strrchr(start, '.'); + tail = strrchr(start, '/'); if (!tail) return 0; *tail = '\0'; mailbox_hash_quota(quota_path, start); @@ -2285,7 +2284,7 @@ char c; if (config_hashimapspool) { - idx = strchr(name, '.'); + idx = strchr(name, '/'); if (idx == NULL) { c = *name; } else { @@ -2301,10 +2300,10 @@ sprintf(buf, "%s/%s", root, name); } - /* change all '.'s to '/' */ - for (p = buf + strlen(root) + 1; *p; p++) { - if (*p == '.') *p = '/'; - } +// /* change all '/'s to '/' */ +// for (p = buf + strlen(root) + 1; *p; p++) { +// if (*p == '/') *p = '/'; +// } } /* simple hash so it's easy to find these things in the filesystem; @@ -2314,7 +2313,7 @@ char *idx; char c; - idx = strchr(qr, '.'); /* skip past user. */ + idx = strchr(qr, '/'); /* skip past user. */ if (idx == NULL) { c = *qr; } else { @@ -2324,5 +2323,7 @@ if (!islower((int) c)) c = 'q'; - sprintf(buf, "%s%s%c/%s", config_dir, FNAME_QUOTADIR, c, qr); +// sprintf(buf, "%s%s%c/%s", config_dir, FNAME_QUOTADIR, c, qr); + sprintf(buf, "%s%s%c/%s", config_dir, FNAME_QUOTADIR, c, qr+5); + } --- mboxlist.c Thu Feb 8 13:29:15 2001 +++ mboxlist.c Tue Feb 13 13:45:09 2001 @@ -357,7 +357,7 @@ /* Search for a parent */ strcpy(parent, name); parentlen = 0; - while ((parentlen==0) && (p = strrchr(parent, '.'))) { + while ((parentlen==0) && (p = strrchr(parent, '/'))) { *p = '\0'; r = mboxlist_mylookup(parent, NULL, NULL, &parentpartition, @@ -408,9 +408,9 @@ } acl = xstrdup(""); - if (!strncmp(name, "user.", 5)) { - if (strchr(name+5, '.')) { - /* Disallow creating user.X.* when no user.X */ + if (!strncmp(name, "user/", 5)) { + if (strchr(name+5, '/')) { + /* Disallow creating user/X/* when no user/X */ free(acl); return IMAP_PERMISSION_DENIED; } @@ -508,9 +508,11 @@ tid = NULL; /* 2. verify ACL's to best of ability (CRASH: abort) */ +syslog(LOG_DEBUG, "Running mboxlist_createmailbox(name:%s, mbtype:%d, partition:%s)", +name, mbtype, partition); r = mboxlist_mycreatemailboxcheck(name, mbtype, partition, isadmin, userid, auth_state, &acl, &newpartition, 1, &tid); + switch (r) { case 0: break; @@ -668,7 +670,7 @@ /* * Delete a mailbox. - * Deleting the mailbox user.FOO deletes the user "FOO". It may only be + * Deleting the mailbox user/FOO deletes the user "FOO". It may only be * performed by an admin. The operation removes the user "FOO"'s * subscriptions and all sub-mailboxes of user.FOO * @@ -687,7 +689,7 @@ int r; char *acl; long access; - int deleteuser = 0; /* if we are deleting user.<user> */ + int deleteuser = 0; /* if we are deleting user/<user> */ struct mailbox mailbox; int deletequotaroot = 0; char *path; @@ -697,8 +699,8 @@ retry: /* Check for request to delete a user: - user.<x> with no dots after it */ - if (!strncmp(name, "user.", 5) && !strchr(name+5, '.')) { + user/<x> with no dots after it */ + if (!strncmp(name, "user/", 5) && !strchr(name+5, '/')) { /* Can't DELETE INBOX (your own inbox) */ if (!strcmp(name+5, userid)) { r = IMAP_MAILBOX_NOTSUPPORTED; @@ -898,7 +900,7 @@ r = IMAP_MAILBOX_EXISTS; goto done; } - } else if (!strncmp(oldname, "user.", 5) && !strchr(oldname+5, '.')) { + } else if (!strncmp(oldname, "user/", 5) && !strchr(oldname+5, '/')) { if (!strcmp(oldname+5, userid)) { /* Special case of renaming inbox */ access = cyrus_acl_myrights(auth_state, oldacl); @@ -923,7 +925,7 @@ /* Check ability to create new mailbox */ if (!partitionmove) { - if (!strncmp(newname, "user.", 5) && !strchr(newname+5, '.')) { + if (!strncmp(newname, "user/", 5) && !strchr(newname+5, '/')) { /* Even admins can't rename to user's inboxes */ r = IMAP_MAILBOX_NOTSUPPORTED; goto done; @@ -1114,10 +1116,10 @@ int mbtype; struct txn *tid = NULL; - if (!strncmp(name, "user.", 5) && - !strchr(userid, '.') && + if (!strncmp(name, "user/", 5) && + !strchr(userid, '/') && !strncmp(name+5, userid, useridlen) && - (name[5+useridlen] == '\0' || name[5+useridlen] == '.')) { + (name[5+useridlen] == '\0' || name[5+useridlen] == '/')) { isusermbox = 1; } @@ -1284,7 +1286,7 @@ if (!rock->inbox && rock->usermboxname && keylen >= rock->usermboxnamelen && (keylen == rock->usermboxnamelen || - key[rock->usermboxnamelen] == '.') && + key[rock->usermboxnamelen] == '/') && !strncmp(key, rock->usermboxname, rock->usermboxnamelen)) { /* this would've been output with the inbox stuff, so skip it */ return 0; @@ -1351,7 +1353,7 @@ if (!rock->inbox && rock->usermboxname && !strncmp(namebuf, rock->usermboxname, rock->usermboxnamelen) && (keylen == rock->usermboxnamelen || - namebuf[rock->usermboxnamelen] == '.')) { + namebuf[rock->usermboxnamelen] == '/')) { /* this would've been output with the inbox stuff, so skip it */ return 0; } @@ -1428,9 +1430,9 @@ cbrock.procrock = rock; /* Build usermboxname */ - if (userid && !strchr(userid, '.') && + if (userid && !strchr(userid, '/') && strlen(userid)+5 < MAX_MAILBOX_NAME) { - strcpy(usermboxname, "user."); + strcpy(usermboxname, "user/"); strcat(usermboxname, userid); usermboxnamelen = strlen(usermboxname); } @@ -1455,7 +1457,7 @@ r = (*proc)(usermboxname, usermboxnamelen, 1, rock); } } - strcpy(usermboxname+usermboxnamelen, "."); + strcpy(usermboxname+usermboxnamelen, "/"); usermboxnamelen++; cbrock.usermboxname = usermboxname; @@ -1475,12 +1477,12 @@ *p = '\0'; /* - * If user.X.* or INBOX.* can match pattern, + * If user/X/* or INBOX/* can match pattern, * search for those mailboxes next */ if (userid && (!strncmp(usermboxname, pattern, usermboxnamelen-1) || - !strncasecmp("inbox.", pattern, prefixlen < 6 ? prefixlen : 6))) { + !strncasecmp("inbox/", pattern, prefixlen < 6 ? prefixlen : 6))) { if (!strncmp(usermboxname, pattern, usermboxnamelen-1)) { cbrock.inboxoffset = 0; @@ -1527,7 +1529,7 @@ struct quota quota; int r; - if (!root[0] || root[0] == '.' || strchr(root, '/') + if (!root[0] || root[0] == '/' || strchr(root+5, '/') || strchr(root, '*') || strchr(root, '%') || strchr(root, '?')) { return IMAP_MAILBOX_BADNAME; } @@ -1570,7 +1572,7 @@ } strcpy(pattern, quota.root); - strcat(pattern, ".*"); + strcat(pattern, "/*"); mboxlist_newquota = "a; /* top level mailbox */ @@ -1770,6 +1772,7 @@ if (!islower((int) c)) { c = 'q'; } + sprintf(fname, "%s%s%c/%s%s", config_dir, FNAME_USERDIR, c, userid, FNAME_SUBSSUFFIX); @@ -1791,10 +1794,10 @@ char inboxname[MAX_MAILBOX_NAME+1]; /* Users without INBOXes may not keep subscriptions */ - if (strchr(userid, '.') || strlen(userid) + 6 > MAX_MAILBOX_NAME) { + if (strchr(userid, '/') || strlen(userid) + 6 > MAX_MAILBOX_NAME) { return IMAP_PERMISSION_DENIED; } - strcpy(inboxname, "user."); + strcpy(inboxname, "user/"); strcat(inboxname, userid); if (mboxlist_lookup(inboxname, NULL, NULL, NULL) != 0) { return IMAP_PERMISSION_DENIED; @@ -1854,9 +1857,9 @@ } /* Build usermboxname */ - if (userid && !strchr(userid, '.') && + if (userid && !strchr(userid, '/') && strlen(userid)+5 < MAX_MAILBOX_NAME) { - strcpy(usermboxname, "user."); + strcpy(usermboxname, "user/"); strcat(usermboxname, userid); usermboxnamelen = strlen(usermboxname); } @@ -1881,7 +1884,7 @@ r = (*proc)(usermboxname, usermboxnamelen, 1, rock); } } - strcpy(usermboxname+usermboxnamelen, "."); + strcpy(usermboxname+usermboxnamelen, "/"); usermboxnamelen++; cbrock.usermboxname = usermboxname; @@ -1898,12 +1901,12 @@ *p = '\0'; /* - * If user.X.* or INBOX.* can match pattern, + * If user/X/* or INBOX/* can match pattern, * search for those mailboxes next */ if (userid && (!strncmp(usermboxname, pattern, usermboxnamelen-1) || - !strncasecmp("inbox.", pattern, prefixlen < 6 ? prefixlen : 6))) { + !strncasecmp("inbox/", pattern, prefixlen < 6 ? prefixlen : 6))) { if (!strncmp(usermboxname, pattern, usermboxnamelen-1)) { cbrock.inboxoffset = 0; --- mboxname.c Thu Feb 8 13:37:22 2001 +++ mboxname.c Mon Feb 12 14:45:31 2001 @@ -59,12 +59,12 @@ #include "mboxname.h" -/* Mailbox patterns which the design of the server prohibits */ +/* Mailbox patterns which the design of the server prohibits + "* / *", */ static char *badmboxpatterns[] = { "", "*\t*", "*\n*", - "*/*", ".*", "*.", "*..*", @@ -106,9 +106,9 @@ { if ((name[0] == 'i' || name[0] == 'I') && !strncasecmp(name, "inbox", 5) && - (name[5] == '\0' || name[5] == '.')) { + (name[5] == '\0' || name[5] == '/')) { - if (!userid || strchr(userid, '.')) { + if (!userid || strchr(userid, '/')) { return IMAP_MAILBOX_BADNAME; } @@ -116,7 +116,7 @@ return IMAP_MAILBOX_BADNAME; } - strcpy(result, "user."); + strcpy(result, "user/"); strcat(result, userid); strcat(result, name+5); return 0; @@ -134,9 +134,9 @@ */ int mboxname_userownsmailbox(char *userid, char *name) { - if (!strchr(userid, '.') && !strncmp(name, "user.", 5) && + if (!strchr(userid, '/') && !strncmp(name, "user/", 5) && !strncmp(name+5, userid, strlen(userid)) && - name[5+strlen(userid)] == '.') { + name[5+strlen(userid)] == '/') { return 1; } return 0; @@ -153,7 +153,7 @@ while ((c = *name++)!=0) { switch (c) { - case '.': + case '/': if (!sawnonnumeric) return IMAP_MAILBOX_BADNAME; sawnonnumeric = 0; break; @@ -184,7 +184,7 @@ * Apply site policy restrictions on mailbox names. * Restrictions are hardwired for now. */ -#define GOODCHARS " +,-.0123456789:=@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~" +#define GOODCHARS " ++,-.0123456789:=@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~/" int mboxname_policycheck(char *name) { int i; --- pop3d.c Thu Feb 8 13:43:54 2001 +++ pop3d.c Thu Feb 8 13:46:07 2001 @@ -765,7 +765,7 @@ shut_down(0); } else if (!(p = auth_canonifyid(user)) || - strchr(p, '.') || strlen(p) + 6 > MAX_MAILBOX_PATH) { + strchr(p, '/') || strlen(p) + 6 > MAX_MAILBOX_PATH) { prot_printf(popd_out, "-ERR Invalid user\r\n"); syslog(LOG_NOTICE, "badlogin: %s plaintext %s invalid user", @@ -1044,7 +1044,7 @@ popd_login_time = time(0); - strcpy(inboxname, "user."); + strcpy(inboxname, "user/"); strcat(inboxname, popd_userid); r = mailbox_open_header(inboxname, 0, &mboxstruct); if (r) { --- pop3proxyd.c Thu Feb 8 13:50:42 2001 +++ pop3proxyd.c Thu Feb 8 13:52:26 2001 @@ -594,7 +594,7 @@ shutdown_file(); /* check for shutdown file */ if (!(p = auth_canonifyid(user)) || - strchr(p, '.') || strlen(p) + 6 > MAX_MAILBOX_PATH) { + strchr(p, '/') || strlen(p) + 6 > MAX_MAILBOX_PATH) { prot_printf(popd_out, "-ERR Invalid user\r\n"); syslog(LOG_NOTICE, "badlogin: %s plaintext %s invalid user", @@ -1023,7 +1023,7 @@ char *server; /* have to figure out what server to connect to */ - strcpy(inboxname, "user."); + strcpy(inboxname, "user/"); strcat(inboxname, popd_userid); r = mboxlist_lookup(inboxname, &server, NULL, NULL); if (!r) fatal("couldn't find backend server", EC_CONFIG); --- proxyd.c Thu Feb 8 13:50:33 2001 +++ proxyd.c Tue Feb 13 10:52:45 2001 @@ -853,7 +853,7 @@ struct backend *s = NULL; if (strlen(proxyd_userid) > MAX_MAILBOX_NAME - 30) return NULL; - strcpy(inbox, "user."); + strcpy(inbox, "user/"); strcat(inbox, proxyd_userid); r = mlookup(inbox, &server, NULL, NULL); @@ -885,9 +885,9 @@ int r; struct auth_state *authstate; - if (strchr(user, '.') || strlen(user)+6 >= sizeof(inboxname)) return 0; + if (strchr(user, '/') || strlen(user)+6 >= sizeof(inboxname)) return 0; - strcpy(inboxname, "user."); + strcpy(inboxname, "user/"); strcat(inboxname, user); if (!(authstate = auth_newstate(auth_identity, (char *)0)) || @@ -3342,7 +3342,7 @@ r = IMAP_PERMISSION_DENIED; } - if (name[0] && name[strlen(name)-1] == '.') { + if (name[0] && name[strlen(name)-1] == '/') { /* We don't care about trailing hierarchy delimiters. */ name[strlen(name)-1] = '\0'; } @@ -3602,7 +3602,7 @@ if (!pattern[0] && !subscribed) { /* Special case: query top-level hierarchy separator */ - prot_printf(proxyd_out, "* LIST (\\Noselect) \".\" \"\"\r\n"); + prot_printf(proxyd_out, "* LIST (\\Noselect) \"/\" \"\"\r\n"); } else if (subscribed) { /* do an LSUB command; contact our INBOX */ if (!backend_inbox) { backend_inbox = proxyd_findinboxserver(); @@ -3619,7 +3619,7 @@ } } else { /* do a LIST locally */ /* Do we need to concatenate fields? */ - if (!ignorereference || pattern[0] == '.') { + if (!ignorereference || pattern[0] == '/') { /* Either * - name begins with dot * - we're configured to honor the reference argument */ @@ -3634,7 +3634,7 @@ if (*reference) { /* check for LIST A. .B, change to LIST "" A.B */ - if (reference[reflen-1] == '.' && pattern[0] == '.') { + if (reference[reflen-1] == '/' && pattern[0] == '/') { reference[--reflen] = '\0'; } strcpy(buf, reference); @@ -3806,11 +3806,11 @@ if (!canon_identifier) { rightsdesc = "\"\""; } - else if (!strncmp(mailboxname, "user.", 5) && - !strchr(canon_identifier, '.') && + else if (!strncmp(mailboxname, "user/", 5) && + !strchr(canon_identifier, '/') && !strncmp(mailboxname+5, canon_identifier, canonidlen) && (mailboxname[5+canonidlen] == '\0' || - mailboxname[5+canonidlen] == '.')) { + mailboxname[5+canonidlen] == '/')) { rightsdesc = "lca r s w i p d 0 1 2 3 4 5 6 7 8 9"; } else { @@ -4202,10 +4202,10 @@ return 0; } - if (!(strncmp(name, "INBOX.", 6))) { + if (!(strncmp(name, "INBOX/", 6))) { /* The user has a "personal" namespace. */ sawone[NAMESPACE_INBOX] = 1; - } else if (!(strncmp(name, "user.", 5))) { + } else if (!(strncmp(name, "user/", 5))) { /* The user can see the "other users" namespace. */ sawone[NAMESPACE_USER] = 1; } else { @@ -4231,9 +4231,9 @@ proxyd_authstate, namespacedata, (void*) sawone); prot_printf(proxyd_out, "* NAMESPACE %s %s %s\r\n", - (sawone[NAMESPACE_INBOX]) ? "((\"INBOX.\" \".\"))" : "NIL", - (sawone[NAMESPACE_USER]) ? "((\"user.\" \".\"))" : "NIL", - (sawone[NAMESPACE_SHARED]) ? "((\"\" \".\"))" : "NIL"); + (sawone[NAMESPACE_INBOX]) ? "((\"INBOX/\" \"/\"))" : "NIL", + (sawone[NAMESPACE_USER]) ? "((\"user/\" \"/\"))" : "NIL", + (sawone[NAMESPACE_SHARED]) ? "((\"\" \"/\"))" : "NIL"); prot_printf(proxyd_out, "%s OK %s\r\n", tag, error_message(IMAP_OK_COMPLETED)); @@ -4540,10 +4540,10 @@ if (lastnamedelayed) { if (name && strncmp(lastname, name, strlen(lastname)) == 0 && - name[strlen(lastname)] == '.') { + name[strlen(lastname)] == '/') { lastnamehassub = 1; } - prot_printf(proxyd_out, "* %s (%s) \".\" ", cmd, + prot_printf(proxyd_out, "* %s (%s) \"/\" ", cmd, lastnamehassub ? "" : "\\Noinferiors"); printastring(lastname); prot_printf(proxyd_out, "\r\n"); @@ -4580,7 +4580,7 @@ c = name[matchlen]; if (c) name[matchlen] = '\0'; - prot_printf(proxyd_out, "* %s (%s) \".\" ", cmd, c ? "\\Noselect" : ""); + prot_printf(proxyd_out, "* %s (%s) \"/\" ", cmd, c ? "\\Noselect" : ""); printstring(name); prot_printf(proxyd_out, "\r\n"); if (c) name[matchlen] = c; --- sendmail-map.c Thu Feb 8 13:52:49 2001 +++ sendmail-map.c Thu Feb 8 13:53:22 2001 @@ -187,7 +187,7 @@ server = (char *) xmalloc(sizeof(char) * url->len); mailbox = (char *) xmalloc(sizeof(char) * 2 * url->len); imapurl_fromURL(server, mailbox, url->data); - if (strncmp(mailbox, "user.", 5) || strchr(mailbox + 5, '.')) { + if (strncmp(mailbox, "user/", 5) || strchr(mailbox + 5, '/')) { syslog(LOG_NOTICE, "%s: not a user mailbox?!?", mailbox); goto ret; } @@ -247,7 +247,7 @@ error_message(r)); } - if (strncmp(mailbox, "user.", 5) || strchr(mailbox + 5, '.')) { + if (strncmp(mailbox, "user/", 5) || strchr(mailbox + 5, '/')) { syslog(LOG_NOTICE, "%s: not a user mailbox?!?", mailbox); return; } @@ -328,7 +328,7 @@ mailbox = (char *) xmalloc(sizeof(char) * 2 * url->len); imapurl_fromURL(server, mailbox, url->data); - if (strncmp(mailbox, "user.", 5) || strchr(mailbox + 5, '.')) { + if (strncmp(mailbox, "user/", 5) || strchr(mailbox + 5, '/')) { syslog(LOG_NOTICE, "%s: not a user mailbox?!?", mailbox); goto ret; }
--- glob.c Thu Feb 8 13:47:41 2001 +++ glob.c Tue Feb 13 11:49:33 2001 @@ -53,7 +53,7 @@ #include "glob.h" #include "xmalloc.h" -#define SEPCHAR '.' +#define SEPCHAR '/' /* name of "INBOX" -- must have no repeated substrings */ static char inbox[] = "INBOX"; @@ -410,7 +410,7 @@ char* argv[]; { glob *g = glob_init_suppress(argv[1], GLOB_INBOXCASE|GLOB_HIERARCHY, - "user.nifty"); + "user/nifty"); char text[1024]; int len; long min;