[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mailbox path formatting feature



On 09-Sep-99 at 19:04, Matti Aarnio (mea@nic.funet.fi) wrote:

> > what do you think about the following feature.  If you specify a
> > special new variable in zmailer.conf, it overrides MAILBOX variable
> > and allows to specify the format of the path to the user's mailbox,
> > that may include userid, homedir, PJW hash, domain etc.  Like this:
> 
>      How about, if "MAILBOX" variable has %-char in it, it
>      will be interpreted in this manner.

I did not dare to suggest it because it's not very kosher ;)
If you approve, good.  I'm on the way.

>      for (;*fmt;++fmt) {
>        switch (*fmt) {
>        '%X':
>           if (!hash) hash = crc32(username);
>        '%x':
>           if (!hash) hash = pjwhash32(username);
>           c = 'A' + hash % 26;
>           hash /= 26;
>           break;
>        }
>        *out++ = c;
>      }
> 
>      You get the idea :)
>      (Only one hash can be calculated per path.)

Neat.  I'll do this way.

> > # %d - least number guaranteening unique filename (for MH style boxes)
> > # %D - the same padded by leading zeroes to fixed length

...but probably I'm not going to implement this for now.  Watching for
for race conditions would be not so easy.

Eugene

(to the side: why the hell there are different exists() and creatembox()
functions? They should obviously be one.  And 3400 lines of C code...)