Re: Patch to change dots to slashes.

2001-06-22 Thread Nick Hudson

Hi,

Will this ever be integrated into the cyrus CVS tree?

Thanks,
Nick

On Thu, 21 Jun 2001 17:52:08 -0700, David Fuchs wrote:

>  I've attached it to this message.
>  
>  Just extract cyrus-imapd-2.0.14, cd to the directory, and run:
>  "patch < /path/to/cyrus-imapd-2.0.14-DOTPATCH.diff"
>  
>  This is a later version of the original patch I released, it fixes a
problem
>  setting/parsing quota files.
>  
>  -David Fuchs
>  
>  - Original Message -
>  From: Kevin J. Menard, Jr. <[EMAIL PROTECTED]>
>  To: David Fuchs <[EMAIL PROTECTED]>
>  Cc: Cyrus Info Mailing List <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
>  Sent: Thursday, June 21, 2001 5:47 PM
>  Subject: Re: Patch to change dots to slashes.
>  
>  
>  > Hey David,
>  >
>  >
>  > Wednesday, February 14, 2001, 6:47:52 PM, you wrote:
>  >
>  > DF> Attached are two patch-files that will change the Netnews dot
>  delimiter
>  > DF> to a slash in Cyrus.  I created these patches from the sources for
>  > DF> 2.0.11 (you shouldn't need 2.0.11 to apply it though).  The first
file
>  > DF> (imappatch) needs to be run in the IMAP directory of the Cyrus
>  sources.
>  > DF> The second file (libpatch) needs to be run in the lib directory of
the
>  > DF> Cyrus sources.
>  >
>  > DF> User mailboxes will act differently with the patch applied.  Dots
are
>  > DF> now allowed in usernames, but not slashes.
>  >
>  > DF> Example of a mailbox listing:
>  >
>  > cyradm>> lm
>  > DF> user/david.fuchs
>  > DF> user/david.fuchs/subfolder
>  >
>  > DF> I've tested this patch with Microsoft Outlook Express and Pine as
mail
>  > DF> clients (POP3 and IMAP).  Everything seems to work fine.  I'm not a
>  > DF> professional developer, so if there are any problems please mail
me.
>  >
>  > DF> -David Fuchs
>  >
>  > Anyone have a patch for 2.0.14?
>  >
>  > --
>  >  Kevin
>  >
>  >
>  
>  << File Attachment Removed: "application/octet-stream;
>   name="cyrus-imapd-2.0.14-DOTPATCH.diff"" >>


--
aka [EMAIL PROTECTED], [EMAIL PROTECTED]





___
 Get 100% private, FREE email for life from Excite UK
 Visit http://inbox.excite.co.uk/ 




Re: Patch to change dots to slashes.

2001-06-21 Thread David Fuchs

I've attached it to this message.

Just extract cyrus-imapd-2.0.14, cd to the directory, and run:
"patch < /path/to/cyrus-imapd-2.0.14-DOTPATCH.diff"

This is a later version of the original patch I released, it fixes a problem
setting/parsing quota files.

-David Fuchs

- Original Message -
From: Kevin J. Menard, Jr. <[EMAIL PROTECTED]>
To: David Fuchs <[EMAIL PROTECTED]>
Cc: Cyrus Info Mailing List <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, June 21, 2001 5:47 PM
Subject: Re: Patch to change dots to slashes.


> Hey David,
>
>
> Wednesday, February 14, 2001, 6:47:52 PM, you wrote:
>
> DF> Attached are two patch-files that will change the Netnews dot
delimiter
> DF> to a slash in Cyrus.  I created these patches from the sources for
> DF> 2.0.11 (you shouldn't need 2.0.11 to apply it though).  The first file
> DF> (imappatch) needs to be run in the IMAP directory of the Cyrus
sources.
> DF> The second file (libpatch) needs to be run in the lib directory of the
> DF> Cyrus sources.
>
> DF> User mailboxes will act differently with the patch applied.  Dots are
> DF> now allowed in usernames, but not slashes.
>
> DF> Example of a mailbox listing:
>
> cyradm>> lm
> DF> user/david.fuchs
> DF> user/david.fuchs/subfolder
>
> DF> I've tested this patch with Microsoft Outlook Express and Pine as mail
> DF> clients (POP3 and IMAP).  Everything seems to work fine.  I'm not a
> DF> professional developer, so if there are any problems please mail me.
>
> DF> -David Fuchs
>
> Anyone have a patch for 2.0.14?
>
> --
>  Kevin
>
>

 cyrus-imapd-2.0.14-DOTPATCH.diff


Re: Patch to change dots to slashes.

2001-06-21 Thread Kevin J. Menard, Jr.

Hey David,


Wednesday, February 14, 2001, 6:47:52 PM, you wrote:

DF> Attached are two patch-files that will change the Netnews dot delimiter
DF> to a slash in Cyrus.  I created these patches from the sources for
DF> 2.0.11 (you shouldn't need 2.0.11 to apply it though).  The first file
DF> (imappatch) needs to be run in the IMAP directory of the Cyrus sources.
DF> The second file (libpatch) needs to be run in the lib directory of the
DF> Cyrus sources.

DF> User mailboxes will act differently with the patch applied.  Dots are
DF> now allowed in usernames, but not slashes.

DF> Example of a mailbox listing:

cyradm>> lm
DF> user/david.fuchs
DF> user/david.fuchs/subfolder

DF> I've tested this patch with Microsoft Outlook Express and Pine as mail
DF> clients (POP3 and IMAP).  Everything seems to work fine.  I'm not a
DF> professional developer, so if there are any problems please mail me.

DF> -David Fuchs

Anyone have a patch for 2.0.14?

-- 
 Kevin




Re: Patch to change dots to slashes.

2001-05-18 Thread Chris Dunlop

This is a modification of my earlier patch to enable changing the mailbox
delimiter to a different character (eg. a slash), which was based almost
entirely on David Fuchs' original patch to change the delimiter to a
slash.

This patch fixes a problem where the changed delimiter wasn't recognized
in patten searches (eg. LSUB "" %).

The actual change from the previous patches is immediately below, but
I'm including the full patch (including this latest fix) at the end of
this message for completeness.

<---> cyrus-imapd-2.0.12/lib/glob.c Thu Dec 21 09:53:49 2000
<+++> cyrus-imapd-2.0.12/lib/glob.c Thu May 17 18:13:21 2001
@@ -80,7 +80,7 @@
 g = (glob *) fs_get(sizeof (glob) + slen + strlen(str) + 1);
 if (g != 0) {
 strcpy(g->inbox, inbox);
-   g->sep_char = '.';
+   g->sep_char = DELIMITER_CHAR;
dst = g->str;
/* if we're doing a substring match, put a '*' prefix (1) */
if (flags & GLOB_SUBSTRING) {


I haven't had time yet to see how this patch applies to the recently
release cyrus-imapd-2.0.13.

Cheers,

Chris,
OnTheNet

--- Full patch with original note 

This is a patch to enable changing the mailbox delimiter to an different
character, such as a slash.  This patch is mostly a modified version of
David Fuchs' original patch to change the dot delimiter to a slash.  The
major differences are:

o You can change the delimiter to any character (within reason!) by
  changing two #defines in imap/mailbox.h:

  #define DELIMITER_CHAR '/'
  #define DELIMITER_STR "/"

o It adds some sanity checking for mailbox names.  In particular it
  explicity disallows mailbox names of cyrus.cache, cyrus.index etc.,
  and explicitly disallows patterns like './' (which includes '../').
  See badmboxpatterns in imap/mboxname.c. 

o There are one or two additional places over David's patch where I
  think the delimiter needs to be changed.

Note: this patch has not yet seen extensive use in a high traffic
environment, so... Buyer Beware!

One thing it might be nice to see, but I haven't had the time to
implement, is setting the delimiter character using the configure
script.

Cheers,

Chris,
OnTheNet


diff -u -r cyrus-imapd-2.0.12/imap/acapmbox.c cyrus-imapd-2.0.12/imap/acapmbox.c
--- cyrus-imapd-2.0.12/imap/acapmbox.c  Sat Feb 17 05:54:43 2001
+++ cyrus-imapd-2.0.12/imap/acapmbox.c  Thu Apr 12 17:26:16 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" DELIMITER_STR, 5)) {
char *p;
 
/* user+detail */
strcpy(postaddr, name + 5);
-   p = strchr(postaddr, '.');
+   p = strchr(postaddr, DELIMITER_CHAR);
if (p) *p = '+';
strcat(postaddr, "@");
strcat(postaddr, server);
@@ -243,9 +243,11 @@
 
 /* needs to convert from mUTF7 to UTF-8 */
 snprintf(ret, MAX_MAILBOX_PATH, "%s/%s",  global_dataset, mailbox_name);
+#if DELIMITER_CHAR != '/'
 for (j = strlen(global_dataset); ret[j] != '\0'; j++) {
-   if (ret[j] == '.') ret[j] = '/';
+   if (ret[j] == DELIMITER_CHAR) ret[j] = '/';
 }
+#endif
 
 return 0;
 }
@@ -266,9 +268,11 @@
 }
 
 strcpy(ret, entryname + gdlen + 1);
+#if DELIMITER_CHAR != '/'
 for (j = 0; ret[j] != '\0'; j++) {
-   if (ret[j] == '/') ret[j] = '.';
+   if (ret[j] == '/') ret[j] = DELIMITER_CHAR;
 }
+#endif
 
 return 0;
 }
diff -u -r cyrus-imapd-2.0.12/imap/arbitron.c cyrus-imapd-2.0.12/imap/arbitron.c
--- cyrus-imapd-2.0.12/imap/arbitron.c  Wed May 24 06:52:12 2000
+++ cyrus-imapd-2.0.12/imap/arbitron.c  Thu Apr 12 13:40:53 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" DELIMITER_STR, 5) &&
+   !memchr(line, DELIMITER_CHAR, useridlen) &&
!strncasecmp(arbitronargs->name+5, line, useridlen) &&
-   (arbitronargs->name[5+useridlen] == '.' ||
+   (arbitronargs->name[5+useridlen] == DELIMITER_CHAR ||
 arbitronargs->name[5+useridlen] == '\0')) {
return 0;
 }
diff -u -r cyrus-imapd-2.0.12/imap/duplicate.c cyrus-imapd-2.0.12/imap/duplicate.c
--- cyrus-imapd-2.0.12/imap/duplicate.c Sat Jan 27 13:05:52 2001
+++ cyrus-imapd-2.0.12/imap/duplicate.c Thu Apr 12 15:08:49 2001
@@ -75,6 +75,7 @@
 #include "imapconf.h"
 #include "exitcodes.h"
 #include "xmalloc.h"
+#include "mailbox.h"
 
 #include "duplicate.h"
 
@@ -160,11 +161,11 @@
 char *idx;
 char c;
   
-idx = strchr(mbox,'.');   /* skip past user. */
-if (idx == NULL) { /* no '.' so just use mbox */
+idx = strchr(mbox, DELIMITER_CHAR);   /* skip past user. */
+if (idx == NULL) { /* no DELIMITER so just use mbox */

Re: Patch to change dots to slashes.

2001-04-27 Thread Chris Dunlop

This is a modification of my earlier patch to enable changing the mailbox
delimiter to a different character (eg. a slash), which was based almost
entirely on David Fuchs' original patch to change the delimiter to a
slash.

This patch fixes a problem with both earlier patches which broke setting
quotas on sub-folders.

The actual changes from the previous patch are those in
mailbox.c:mailbox_hash_quota(), but I'm including the full patch here
for completeness, along with my original note.

Cheers,

Chris,
OnTheNet


> This is a patch to enable changing the mailbox delimiter to an different
> character, such as a slash.  This patch is mostly a modified version of
> David Fuchs' original patch to change the dot delimiter to a slash.  The
> major differences are:
> 
> o You can change the delimiter to any character (within reason!) by
>   changing two #defines in imap/mailbox.h:
> 
>   #define DELIMITER_CHAR '/'
>   #define DELIMITER_STR "/"
> 
> o It adds some sanity checking for mailbox names.  In particular it
>   explicity disallows mailbox names of cyrus.cache, cyrus.index etc.,
>   and explicitly disallows patterns like './' (which includes '../').
>   See badmboxpatterns in imap/mboxname.c. 
> 
> o There are one or two additional places over David's patch where I
>   think the delimiter needs to be changed.
> 
> Note: this patch has not yet seen extensive use in a high traffic
> environment, so... Buyer Beware!
> 
> One thing it might be nice to see, but I haven't had the time to
> implement, is setting the delimiter character using the configure
> script.
> 
> Cheers,
> 
> Chris,
> OnTheNet


diff -u -r cyrus-imapd-2.0.12/imap/acapmbox.c cyrus-imapd-2.0.12/imap/acapmbox.c
--- cyrus-imapd-2.0.12/imap/acapmbox.c  Sat Feb 17 05:54:43 2001
+++ cyrus-imapd-2.0.12/imap/acapmbox.c  Thu Apr 12 17:26:16 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" DELIMITER_STR, 5)) {
char *p;
 
/* user+detail */
strcpy(postaddr, name + 5);
-   p = strchr(postaddr, '.');
+   p = strchr(postaddr, DELIMITER_CHAR);
if (p) *p = '+';
strcat(postaddr, "@");
strcat(postaddr, server);
@@ -243,9 +243,11 @@
 
 /* needs to convert from mUTF7 to UTF-8 */
 snprintf(ret, MAX_MAILBOX_PATH, "%s/%s",  global_dataset, mailbox_name);
+#if DELIMITER_CHAR != '/'
 for (j = strlen(global_dataset); ret[j] != '\0'; j++) {
-   if (ret[j] == '.') ret[j] = '/';
+   if (ret[j] == DELIMITER_CHAR) ret[j] = '/';
 }
+#endif
 
 return 0;
 }
@@ -266,9 +268,11 @@
 }
 
 strcpy(ret, entryname + gdlen + 1);
+#if DELIMITER_CHAR != '/'
 for (j = 0; ret[j] != '\0'; j++) {
-   if (ret[j] == '/') ret[j] = '.';
+   if (ret[j] == '/') ret[j] = DELIMITER_CHAR;
 }
+#endif
 
 return 0;
 }
diff -u -r cyrus-imapd-2.0.12/imap/arbitron.c cyrus-imapd-2.0.12/imap/arbitron.c
--- cyrus-imapd-2.0.12/imap/arbitron.c  Wed May 24 06:52:12 2000
+++ cyrus-imapd-2.0.12/imap/arbitron.c  Thu Apr 12 13:40:53 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" DELIMITER_STR, 5) &&
+   !memchr(line, DELIMITER_CHAR, useridlen) &&
!strncasecmp(arbitronargs->name+5, line, useridlen) &&
-   (arbitronargs->name[5+useridlen] == '.' ||
+   (arbitronargs->name[5+useridlen] == DELIMITER_CHAR ||
 arbitronargs->name[5+useridlen] == '\0')) {
return 0;
 }
diff -u -r cyrus-imapd-2.0.12/imap/duplicate.c cyrus-imapd-2.0.12/imap/duplicate.c
--- cyrus-imapd-2.0.12/imap/duplicate.c Sat Jan 27 13:05:52 2001
+++ cyrus-imapd-2.0.12/imap/duplicate.c Thu Apr 12 15:08:49 2001
@@ -75,6 +75,7 @@
 #include "imapconf.h"
 #include "exitcodes.h"
 #include "xmalloc.h"
+#include "mailbox.h"
 
 #include "duplicate.h"
 
@@ -160,11 +161,11 @@
 char *idx;
 char c;
   
-idx = strchr(mbox,'.');   /* skip past user. */
-if (idx == NULL) { /* no '.' so just use mbox */
+idx = strchr(mbox, DELIMITER_CHAR);   /* skip past user. */
+if (idx == NULL) { /* no DELIMITER so just use mbox */
idx = mbox;
 } else {
-   idx++;   /* skip past '.' */
+   idx++;   /* skip past DELIMITER */
 }
 c = (char) tolower((int) *idx);
 if (!islower((int) c)) {
diff -u -r cyrus-imapd-2.0.12/imap/idle_idled.c cyrus-imapd-2.0.12/imap/idle_idled.c
--- cyrus-imapd-2.0.12/imap/idle_idled.cSat Jan 20 03:48:58 2001
+++ cyrus-imapd-2.0.12/imap/idle_idled.cThu Apr 12 13:42:07 2001
@@ -190,7 +190,7 @@
 /* fill the structure */
 idledata.msg = msg;
 idledata.pid = getpid();
-strcpy(idledata.mboxname, mailb

Re: Patch to change dots to slashes.

2001-04-17 Thread Chris Dunlop

This is a patch to enable changing the mailbox delimiter to an different
character, such as a slash.  This patch is mostly a modified version of
David Fuchs' original patch to change the dot delimiter to a slash.  The
major differences are:

o You can change the delimiter to any character (within reason!) by
  changing two #defines in imap/mailbox.h:

  #define DELIMITER_CHAR '/'
  #define DELIMITER_STR "/"

o It adds some sanity checking for mailbox names.  In particular it
  explicity disallows mailbox names of cyrus.cache, cyrus.index etc.,
  and explicitly disallows patterns like './' (which includes '../').
  See badmboxpatterns in imap/mboxname.c. 

o There are one or two additional places over David's patch where I
  think the delimiter needs to be changed.

Note: this patch has not yet seen extensive use in a high traffic
environment, so... Buyer Beware!

One thing it might be nice to see, but I haven't had the time to
implement, is setting the delimiter character using the configure
script.

Cheers,

Chris,
OnTheNet


diff -u -r cyrus-imapd-2.0.12/imap/acapmbox.c cyrus-imapd-2.0.12/imap/acapmbox.c
--- cyrus-imapd-2.0.12/imap/acapmbox.c  Sat Feb 17 05:54:43 2001
+++ cyrus-imapd-2.0.12/imap/acapmbox.c  Thu Apr 12 17:26:16 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" DELIMITER_STR, 5)) {
char *p;
 
/* user+detail */
strcpy(postaddr, name + 5);
-   p = strchr(postaddr, '.');
+   p = strchr(postaddr, DELIMITER_CHAR);
if (p) *p = '+';
strcat(postaddr, "@");
strcat(postaddr, server);
@@ -243,9 +243,11 @@
 
 /* needs to convert from mUTF7 to UTF-8 */
 snprintf(ret, MAX_MAILBOX_PATH, "%s/%s",  global_dataset, mailbox_name);
+#if DELIMITER_CHAR != '/'
 for (j = strlen(global_dataset); ret[j] != '\0'; j++) {
-   if (ret[j] == '.') ret[j] = '/';
+   if (ret[j] == DELIMITER_CHAR) ret[j] = '/';
 }
+#endif
 
 return 0;
 }
@@ -266,9 +268,11 @@
 }
 
 strcpy(ret, entryname + gdlen + 1);
+#if DELIMITER_CHAR != '/'
 for (j = 0; ret[j] != '\0'; j++) {
-   if (ret[j] == '/') ret[j] = '.';
+   if (ret[j] == '/') ret[j] = DELIMITER_CHAR;
 }
+#endif
 
 return 0;
 }
diff -u -r cyrus-imapd-2.0.12/imap/arbitron.c cyrus-imapd-2.0.12/imap/arbitron.c
--- cyrus-imapd-2.0.12/imap/arbitron.c  Wed May 24 06:52:12 2000
+++ cyrus-imapd-2.0.12/imap/arbitron.c  Thu Apr 12 13:40:53 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" DELIMITER_STR, 5) &&
+   !memchr(line, DELIMITER_CHAR, useridlen) &&
!strncasecmp(arbitronargs->name+5, line, useridlen) &&
-   (arbitronargs->name[5+useridlen] == '.' ||
+   (arbitronargs->name[5+useridlen] == DELIMITER_CHAR ||
 arbitronargs->name[5+useridlen] == '\0')) {
return 0;
 }
diff -u -r cyrus-imapd-2.0.12/imap/duplicate.c cyrus-imapd-2.0.12/imap/duplicate.c
--- cyrus-imapd-2.0.12/imap/duplicate.c Sat Jan 27 13:05:52 2001
+++ cyrus-imapd-2.0.12/imap/duplicate.c Thu Apr 12 15:08:49 2001
@@ -75,6 +75,7 @@
 #include "imapconf.h"
 #include "exitcodes.h"
 #include "xmalloc.h"
+#include "mailbox.h"
 
 #include "duplicate.h"
 
@@ -160,11 +161,11 @@
 char *idx;
 char c;
   
-idx = strchr(mbox,'.');   /* skip past user. */
-if (idx == NULL) { /* no '.' so just use mbox */
+idx = strchr(mbox, DELIMITER_CHAR);   /* skip past user. */
+if (idx == NULL) { /* no DELIMITER so just use mbox */
idx = mbox;
 } else {
-   idx++;   /* skip past '.' */
+   idx++;   /* skip past DELIMITER */
 }
 c = (char) tolower((int) *idx);
 if (!islower((int) c)) {
diff -u -r cyrus-imapd-2.0.12/imap/idle_idled.c cyrus-imapd-2.0.12/imap/idle_idled.c
--- cyrus-imapd-2.0.12/imap/idle_idled.cSat Jan 20 03:48:58 2001
+++ cyrus-imapd-2.0.12/imap/idle_idled.cThu Apr 12 13:42:07 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 : DELIMITER_STR);
 
 /* send */
 if (sendto(notify_sock, (void *) &idledata,
diff -u -r cyrus-imapd-2.0.12/imap/imapd.c cyrus-imapd-2.0.12/imap/imapd.c
--- cyrus-imapd-2.0.12/imap/imapd.c Sat Feb 17 05:55:10 2001
+++ cyrus-imapd-2.0.12/imap/imapd.c Thu Apr 12 13:49:19 2001
@@ -233,9 +233,9 @@
 int r;
 struct auth_state *authstate;
 
-if (strchr(user, '.') || strlen(user)+6 >= sizeof(inboxname)) return 0;
+if (strchr(user, DELIMITER_CHAR) || strlen(user)+6 >= sizeo

Re: Patch to change dots to slashes.

2001-03-18 Thread David Fuchs

Thus far I've not had any problems with dots in mailbox names.  I've
tried the different scenarios you've mentioned on my personal computer
(running Microsoft Outlook Express).  I cannot create any mailbox
folders that end with a dot in the name, although you can prefix the
mailbox name with a dot.  You can't create 'cyrus.cache',
'cyrus.header', or any other names that would conflict either...

-David

- Original Message -
From: Lawrence Greenfield <[EMAIL PROTECTED]>
To: David Fuchs <[EMAIL PROTECTED]>; Allan Rafuse <[EMAIL PROTECTED]>
Cc: Cyrus Info Mailing List <[EMAIL PROTECTED]>
Sent: Saturday, March 17, 2001 11:58 AM
Subject: Re: Patch to change dots to slashes.


> While I haven't studied your patch in detail, the normal problem with
> swapping "/" for "." and then allowing "." inside a mailbox component
is
> that the code is not nearly as paranoid as it should be.
>
> What do you do if a user tries creating a mailbox named "." or ".."?
What
> about a mailbox named "5." or "cyrus.cache"?
>
> Larry
>
> --On Tuesday, March 13, 2001 12:33:07 PM -0800 David Fuchs
> <[EMAIL PROTECTED]> wrote:
>
> >
> > 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
> >
>
>
>
>
>




Re: Patch to change dots to slashes.

2001-03-17 Thread Lawrence Greenfield

While I haven't studied your patch in detail, the normal problem with 
swapping "/" for "." and then allowing "." inside a mailbox component is 
that the code is not nearly as paranoid as it should be.

What do you do if a user tries creating a mailbox named "." or ".."?  What 
about a mailbox named "5." or "cyrus.cache"?

Larry

--On Tuesday, March 13, 2001 12:33:07 PM -0800 David Fuchs 
<[EMAIL PROTECTED]> wrote:

>
> 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
>







Re: Patch to change dots to slashes.

2001-03-13 Thread David Fuchs


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.cTue Feb 13 10:36:44 2001
+++ idle_idled.cTue 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(inbox

Re: Patch to change dots to slashes.

2001-03-13 Thread Allan Rafuse

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





Patch to change dots to slashes.

2001-02-14 Thread David Fuchs

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. */

 libpatch
 imappatch