diff -Naur courier-imap-1.4.6.post.configure/imap/fetch.c courier-imap-1.4.6.post.full.patch/imap/fetch.c --- courier-imap-1.4.6.post.configure/imap/fetch.c 2002-05-22 14:00:08.000000000 +0100 +++ courier-imap-1.4.6.post.full.patch/imap/fetch.c 2002-06-22 16:09:56.000000000 +0100 @@ -26,6 +26,7 @@ #include "rfc2045/rfc2045.h" #include "maildir/maildirgetquota.h" #include "maildir/maildirquota.h" +#include "maildir/mdirsep.h" /* Defines the maildir quota separator character */ static const char rcsid[]="$Id: fetch.c,v 1.18 2002/05/22 13:00:07 mrsam Exp $"; @@ -161,8 +162,8 @@ p=malloc(strlen(mi->filename)+20); if (!p) write_error_exit(0); strcpy(p, mi->filename); - if ((q=strrchr(p, ':')) != 0) *q=0; - strcat(p, ":2,"); + if ((q=strrchr(p, MDIRSEP[0])) != 0) *q=0; + strcat(p, MDIRSEP "2,"); append_flags(p, flags); q=malloc(strlen(current_mailbox)+strlen(mi->filename)+sizeof("/cur/")); diff -Naur courier-imap-1.4.6.post.configure/imap/imapd.c courier-imap-1.4.6.post.full.patch/imap/imapd.c --- courier-imap-1.4.6.post.configure/imap/imapd.c 2002-04-17 19:16:12.000000000 +0100 +++ courier-imap-1.4.6.post.full.patch/imap/imapd.c 2002-06-22 16:09:56.000000000 +0100 @@ -70,6 +70,7 @@ #include "maildir/maildirgetquota.h" #include "maildir/maildirquota.h" #include "maildir/maildirmisc.h" +#include "maildir/mdirsep.h" /* Defines the maildir quota separator character */ #include "unicode/unicode.h" @@ -490,8 +491,8 @@ flags->seen=flags->answered=flags->deleted=flags->flagged =flags->recent=flags->drafts=0; - if ((filename=strrchr(filename, ':')) == 0 - || strncmp(filename, ":2,", 3)) return; + if ((filename=strrchr(filename, MDIRSEP[0])) == 0 + || strncmp(filename, MDIRSEP "2,", 3)) return; if (strchr(filename, 'D')) { @@ -599,7 +600,7 @@ sleep(3); } - strcpy(uniqbuf, ":2,"); + strcpy(uniqbuf, MDIRSEP "2,"); append_flags(uniqbuf, flags); if (uniqbuf[3] == 0 && /* No flags, messages goes into new */ @@ -1130,8 +1131,8 @@ /* Don't mark it as deleted in the Trash */ if ((p=strrchr(new_name, '/')) && - (p=strrchr(p, ':')) && - strncmp(p, ":2,", 3) == 0 && + (p=strrchr(p, MDIRSEP[0])) && + strncmp(p, MDIRSEP "2,", 3) == 0 && (p=strchr(p, 'T'))) while ((*p=p[1]) != 0) ++p; @@ -1755,8 +1756,8 @@ { const char *p=infoptr->msgs[i].filename; - p=strrchr(p, ':'); - if (p && strncmp(p, ":2,", 3) == 0 && + p=strrchr(p, MDIRSEP[0]); + if (p && strncmp(p, MDIRSEP "2,", 3) == 0 && strchr(p, 'S')) continue; ++n; } diff -Naur courier-imap-1.4.6.post.configure/imap/imapscanclient.c courier-imap-1.4.6.post.full.patch/imap/imapscanclient.c --- courier-imap-1.4.6.post.configure/imap/imapscanclient.c 2002-05-13 19:28:30.000000000 +0100 +++ courier-imap-1.4.6.post.full.patch/imap/imapscanclient.c 2002-06-22 16:09:57.000000000 +0100 @@ -49,6 +49,7 @@ #include "liblock/liblock.h" #include "maildir/maildircreate.h" #include "maildir/maildirmisc.h" +#include "maildir/mdirsep.h" /* Defines the maildir quota separator character */ #include "imapscanclient.h" #include "imaptoken.h" @@ -396,10 +397,10 @@ p=my_strdup(de->d_name); /* IMAPDB doesn't store the filename flags, so strip them */ - q=strrchr(p, ':'); + q=strrchr(p, MDIRSEP[0]); if (q) *q=0; rc=search_by_filename(tempinfo_array, tempinfo_cnt, &i, p); - if (q) *q=':'; + if (q) *q=MDIRSEP[0]; if (rc == 0) { tempinfo_array[i]->found=1; @@ -475,7 +476,7 @@ z=de->d_name; newname=imapscan_namedir(p, z); - curname=malloc(strlen(newname)+sizeof(":2,")); + curname=malloc(strlen(newname)+sizeof(MDIRSEP "2,")); if (!curname) { unlink(newdbfilepath); @@ -485,8 +486,8 @@ z=strrchr(curname, '/'); memcpy(z-3, "cur", 3); /* Mother of all hacks */ - if (strchr(z, ':') == 0) - strcat(z, ":2,"); + if (strchr(z, MDIRSEP[0]) == 0) + strcat(z, MDIRSEP "2,"); if (rename(newname, curname)) { @@ -557,11 +558,11 @@ for (i=0; ifilename, ':'); + q=strrchr(tempinfo_array[i]->filename, MDIRSEP[0]); if (q) *q=0; fprintf(fp, "%lu %s\n", tempinfo_array[i]->uid, tempinfo_array[i]->filename); - if (q) *q=':'; + if (q) *q=MDIRSEP[0]; } if (fflush(fp) || ferror(fp) || fclose(fp)) { diff -Naur courier-imap-1.4.6.post.configure/imap/mailboxlist.c courier-imap-1.4.6.post.full.patch/imap/mailboxlist.c --- courier-imap-1.4.6.post.configure/imap/mailboxlist.c 2001-12-05 12:15:12.000000000 +0000 +++ courier-imap-1.4.6.post.full.patch/imap/mailboxlist.c 2002-06-22 16:09:57.000000000 +0100 @@ -60,6 +60,7 @@ #include "mailboxlist.h" #include "maildir/maildirmisc.h" +#include "maildir/mdirsep.h" /* Defines the maildir quota separator character */ static const char rcsid[]="$Id: mailboxlist.c,v 1.12 2001/12/05 13:15:11 mrsam Exp $"; @@ -164,8 +165,8 @@ char *p; if (de->d_name[0] == '.') continue; - p=strrchr(de->d_name, ':'); - if (p == 0 || strncmp(p, ":2,", 3) || + p=strrchr(de->d_name, MDIRSEP[0]); + if (p == 0 || strncmp(p, MDIRSEP "2,", 3) || strchr(p, 'S') == 0) { closedir(dirp); diff -Naur courier-imap-1.4.6.post.configure/imap/pop3dserver.c courier-imap-1.4.6.post.full.patch/imap/pop3dserver.c --- courier-imap-1.4.6.post.configure/imap/pop3dserver.c 2001-12-29 03:01:40.000000000 +0000 +++ courier-imap-1.4.6.post.full.patch/imap/pop3dserver.c 2002-06-22 16:09:57.000000000 +0100 @@ -54,6 +54,7 @@ #include "maildir/maildirmisc.h" #include "maildir/maildirquota.h" #include "maildir/maildirgetquota.h" +#include "maildir/mdirsep.h" /* Defines the maildir quota separator character */ extern void pop3dcapa(); @@ -371,7 +372,7 @@ fclose(f); if (lptr) return; - if ((p=strchr(msglist_a[i]->filename, ':')) != 0 && + if ((p=strchr(msglist_a[i]->filename, MDIRSEP[0])) != 0 && (p[1] != '2' || p[2] != ',' || strchr(p, 'S') != 0)) return; @@ -379,7 +380,7 @@ return; strcpy(p, msglist_a[i]->filename); - if (strchr(p, ':') == 0) strcat(p, ":2,"); + if (strchr(p, MDIRSEP[0]) == 0) strcat(p, MDIRSEP "2,"); strcat(p, "S"); if (lptr /* Don't mark as seen for TOP */ @@ -393,14 +394,14 @@ } /* -** The UIDL of the message is really just its filename, up to the first : +** The UIDL of the message is really just its filename, up to the first MDIRSEP character */ static void print_uidl(unsigned i) { const char *p=strchr(msglist_a[i]->filename, '/')+1; - while (*p && *p != ':') + while (*p && *p != MDIRSEP[0]) { if (*p < 0x21 || *p > 0x7E || *p == '\'' || *p == '"' || *p == '+') @@ -636,7 +637,7 @@ o=malloc(strlen(de->d_name)+8); if (!o) continue; strcat(strcpy(n, "new/"), de->d_name); - strcat(strcat(strcpy(o, "cur/"), de->d_name), ":2,"); + strcat(strcat(strcpy(o, "cur/"), de->d_name), MDIRSEP "2,"); rename(n, o); free(n); free(o); diff -Naur courier-imap-1.4.6.post.configure/maildir/maildirfilename.c courier-imap-1.4.6.post.full.patch/maildir/maildirfilename.c --- courier-imap-1.4.6.post.configure/maildir/maildirfilename.c 2000-02-08 01:28:50.000000000 +0000 +++ courier-imap-1.4.6.post.full.patch/maildir/maildirfilename.c 2002-06-22 16:09:59.000000000 +0100 @@ -37,6 +37,7 @@ #include #include "maildirmisc.h" +#include "mdirsep.h" /* Defines the maildir quota separator character */ static const char rcsid[]="$Id: maildirfilename.c,v 1.2 2000/02/08 02:28:49 mrsam Exp $"; @@ -122,7 +123,7 @@ ++b; } - if ( (*a == 0 || *a == ':') && (*b == 0 || *b == ':')) + if ( (*a == 0 || *a == MDIRSEP[0]) && (*b == 0 || *b == MDIRSEP[0])) { free(p); p=malloc(strlen(dir)+strlen(de->d_name)+ @@ -140,7 +141,7 @@ free(dir); return (p); } - if ( *a == 0 || *a == ':' || *b == 0 || *b == ':' || + if ( *a == 0 || *a == MDIRSEP[0] || *b == 0 || *b == MDIRSEP[0] || *a != *b) break; diff -Naur courier-imap-1.4.6.post.configure/maildir/maildirfilter.c courier-imap-1.4.6.post.full.patch/maildir/maildirfilter.c --- courier-imap-1.4.6.post.configure/maildir/maildirfilter.c 2002-02-16 03:09:06.000000000 +0000 +++ courier-imap-1.4.6.post.full.patch/maildir/maildirfilter.c 2002-06-22 16:09:59.000000000 +0100 @@ -7,6 +7,8 @@ #include "maildirfiltertypelist.h" #include "maildirgetquota.h" #include "mailbot.h" +#include "mdirsep.h" /* Defines the maildir quota separator character */ + #include "autoresponse.h" #include "numlib/numlib.h" #include @@ -130,7 +132,7 @@ else for ( ; *c; c++) { /* no control characters */ - if (*c <= ' ' || *c == ':' || *c >= 127 || *c == '\'' || + if (*c <= ' ' || *c == MDIRSEP[0] || *c >= 127 || *c == '\'' || *c == '\\' || *c == '"' || *c == '`' || *c == '/') return (-1); } diff -Naur courier-imap-1.4.6.post.configure/maildir/maildirflags.c courier-imap-1.4.6.post.full.patch/maildir/maildirflags.c --- courier-imap-1.4.6.post.configure/maildir/maildirflags.c 2000-10-07 02:10:20.000000000 +0100 +++ courier-imap-1.4.6.post.full.patch/maildir/maildirflags.c 2002-06-22 16:09:59.000000000 +0100 @@ -5,6 +5,7 @@ #include #include +#include "mdirsep.h" /* Defines the maildir quota separator character */ static const char rcsid[]="$Id: maildirflags.c,v 1.1 2000/10/07 01:10:19 mrsam Exp $"; @@ -15,8 +16,8 @@ if (p) filename=p+1; - p=strrchr(p, ':'); - if (p && strncmp(p, ":2,", 3) == 0 && + p=strrchr(p, MDIRSEP[0]); + if (p && strncmp(p, MDIRSEP "2,", 3) == 0 && strchr(p+3, flag)) return (1); return (0); diff -Naur courier-imap-1.4.6.post.configure/maildir/maildirgetnew.c courier-imap-1.4.6.post.full.patch/maildir/maildirgetnew.c --- courier-imap-1.4.6.post.configure/maildir/maildirgetnew.c 2000-02-14 04:11:40.000000000 +0000 +++ courier-imap-1.4.6.post.full.patch/maildir/maildirgetnew.c 2002-06-22 16:09:59.000000000 +0100 @@ -35,6 +35,7 @@ #endif #include "maildirmisc.h" +#include "mdirsep.h" /* Defines the maildir quota separator character */ static const char rcsid[]="$Id: maildirgetnew.c,v 1.1 2000/02/14 05:11:39 mrsam Exp $"; @@ -77,7 +78,7 @@ if ((np=malloc(strlen(newd)+strlen(de->d_name)+2)) != 0) { if ((cp=malloc(strlen(curd)+strlen(de->d_name) - + sizeof("/:2,"))) != 0) + + sizeof("/" MDIRSEP "2,"))) != 0) { char *a; @@ -85,13 +86,13 @@ de->d_name); strcat(strcat(strcpy(cp, curd), "/"), de->d_name); - a=strchr(cp+strlen(curd), ':'); - if (a && strncmp(a, ":2,", 3)) + a=strchr(cp+strlen(curd), MDIRSEP[0]); + if (a && strncmp(a, MDIRSEP "2,", 3)) { *a=0; a=0; } - if (!a) strcat(cp, ":2,"); + if (!a) strcat(cp, MDIRSEP "2,"); rename(np, cp); free(cp); } diff -Naur courier-imap-1.4.6.post.configure/maildir/maildirparsequota.c courier-imap-1.4.6.post.full.patch/maildir/maildirparsequota.c --- courier-imap-1.4.6.post.configure/maildir/maildirparsequota.c 1999-12-06 12:21:06.000000000 +0000 +++ courier-imap-1.4.6.post.full.patch/maildir/maildirparsequota.c 2002-06-22 16:10:00.000000000 +0100 @@ -7,6 +7,7 @@ #include "config.h" #endif #include "maildirquota.h" +#include "mdirsep.h" /* Defines the maildir quota separator character */ #include #include @@ -20,7 +21,7 @@ if ((o=strrchr(n, '/')) == 0) o=n; for (; *o; o++) - if (*o == ':') break; + if (*o == MDIRSEP[0]) break; yes=0; for ( ; o >= n; --o) { diff -Naur courier-imap-1.4.6.post.configure/maildir/maildirquota.c courier-imap-1.4.6.post.full.patch/maildir/maildirquota.c --- courier-imap-1.4.6.post.configure/maildir/maildirquota.c 2002-05-04 03:16:34.000000000 +0100 +++ courier-imap-1.4.6.post.full.patch/maildir/maildirquota.c 2002-06-22 16:10:00.000000000 +0100 @@ -32,6 +32,7 @@ #include "maildirquota.h" #include "maildirmisc.h" +#include "mdirsep.h" /* Defines the maildir quota separator character */ #include #include #include @@ -639,7 +640,7 @@ for ( ; *n; n++) { - if (n[0] != ':' || n[1] != '2' || + if (n[0] != MDIRSEP[0] || n[1] != '2' || n[2] != ',') continue; n += 3; while (*n >= 'A' && *n <= 'Z') diff -Naur courier-imap-1.4.6.post.configure/maildir/maildirrequota.c courier-imap-1.4.6.post.full.patch/maildir/maildirrequota.c --- courier-imap-1.4.6.post.configure/maildir/maildirrequota.c 1999-12-06 12:21:06.000000000 +0000 +++ courier-imap-1.4.6.post.full.patch/maildir/maildirrequota.c 2002-06-22 16:10:00.000000000 +0100 @@ -8,6 +8,7 @@ #include #include #include "maildirrequota.h" +#include "mdirsep.h" /* Defines the maildir quota separator character */ static const char rcsid[]="$Id: maildirrequota.c,v 1.3 1999/12/06 13:21:05 mrsam Exp $"; @@ -24,7 +25,7 @@ if ((q=strrchr(oldname, '/')) == 0) q=oldname; while (*q) { - if ((*q == ',' && q[1] == 'S' && q[2] == '=') || *q == ':') + if ((*q == ',' && q[1] == 'S' && q[2] == '=') || *q == MDIRSEP[0]) { memcpy(p, oldname, q-oldname); strcpy(p + (q-oldname), buf); diff -Naur courier-imap-1.4.6.post.configure/maildir/maildirshared.c courier-imap-1.4.6.post.full.patch/maildir/maildirshared.c --- courier-imap-1.4.6.post.configure/maildir/maildirshared.c 2001-08-06 22:54:38.000000000 +0100 +++ courier-imap-1.4.6.post.full.patch/maildir/maildirshared.c 2002-06-22 16:10:00.000000000 +0100 @@ -40,6 +40,7 @@ #include "maildirmisc.h" #include "maildircreate.h" #include "maildirsharedrc.h" +#include "mdirsep.h" /* Defines the maildir quota separator character */ static const char rcsid[]="$Id: maildirshared.c,v 1.15 2001/08/06 21:54:14 mrsam Exp $"; @@ -487,7 +488,7 @@ } strcpy(a, de->d_name); strcpy(b, de->d_name); - c=strrchr(a, ':'); + c=strrchr(a, MDIRSEP[0]); if (c) *c=0; if (dbobj_store(obj, a, strlen(a), b, strlen(b), "R")) @@ -553,7 +554,7 @@ return (-1); } strcpy(cur_base, de->d_name); - p=strrchr(cur_base, ':'); + p=strrchr(cur_base, MDIRSEP[0]); if (p) *p=0; cur_name_ptr=dbobj_fetch(obj, cur_base, strlen(cur_base), @@ -754,7 +755,7 @@ } free(slink); - slink=malloc(strlen(cur)+sizeof("/new/:2,")+keylen); + slink=malloc(strlen(cur)+sizeof("/new/" MDIRSEP "2,")+keylen); if (!slink) { perror("malloc"); @@ -764,7 +765,7 @@ strcat(strcpy(slink, cur), "/new/"); q=slink+strlen(slink); memcpy(q, key, keylen); - strcpy(q+keylen, ":2,"); + strcpy(q+keylen, MDIRSEP "2,"); if (rename(tmpname, slink)) { @@ -900,10 +901,10 @@ if (cpy) { - char *p=strrchr(cpy, ':'); + char *p=strrchr(cpy, MDIRSEP[0]); if (p && strchr(p, '/') == 0 && - strncmp(p, ":2,", 3) == 0 && + strncmp(p, MDIRSEP "2,", 3) == 0 && (p=strchr(p, 'T')) != 0) { while ((*p=p[1]) != 0) diff -Naur courier-imap-1.4.6.post.configure/maildir/mdirsep.h courier-imap-1.4.6.post.full.patch/maildir/mdirsep.h --- courier-imap-1.4.6.post.configure/maildir/mdirsep.h 1970-01-01 00:00:00.000000000 +0000 +++ courier-imap-1.4.6.post.full.patch/maildir/mdirsep.h 2002-06-22 16:10:00.000000000 +0100 @@ -0,0 +1,3 @@ +/* Character to separate the quota part of Maildir file names */ +/* #define MDIRSEP ":" is the unix default, but chokes Cygwin */ +#define MDIRSEP "!"