Subject: File names for Imapd

From: Peter Svanberg <[email-masked]>
Date: Mon, 27 Oct 1997 14:17:58 +0100 (MET)

1) I would like to set the default folder directory for Imapd
(to spare our users from making that preferences setting in
Netscape). We run Unix Solaris 2. 

I tried to find out how to do this, but it wasn't easy. Would a
change of the
   static char *blackBoxDefaultHome = NIL;
line in env_unix.c to
   static char *blackBoxDefaultHome = "~/mail";
do it? Will it also work for the mbox driver, i.e. will
it still fetch new messages from the spool directory?

(I saw that these things are debated for the IMAP protocol
but I suppose it isn't solved and implemented in Netscape
yet?)

2) Is it hard to fix so that the mbox driver is the default
for user, even if they don't have an mbox file?

---
Peter Svanberg, NADA, KTH		    E-mail: [email-masked]
Dept of Num An & CS,
Royal Inst of Tech			    Phone: +46 8 790 71 40
S-100 44  Stockholm, SWEDEN		    Fax:   +46 8 10 18 64

---

From: Mark Crispin <[email-masked]>
Date: Mon, 27 Oct 1997 10:07:50 -0800 (PST)

>  static char *blackBoxDefaultHome = "~/mail";

The change to blackBoxDefaultHome is not correct.

The best way is to change routine env_init() in env_unix.c, specifically the
lines:
    if (!blackBox) {		/* not a black box? */
      myHomeDir = cpystr (home);/* use real home directory */
to:
    if (!blackBox) {		/* not a black box? */
      sprintf (tmp,"%s/mail",home);
      myHomeDir = cpystr (tmp);	/* use real home directory */

> for user, even if they don't have an mbox file?

Change routine mbox_valid() in mbox.c to be:

DRIVER *mbox_valid (char *name)
{
  char tmp[MAILTMPLEN];
  char *s = mailboxfile (tmp,name);
                                /* only INBOX */
  return (s && !*s) ? &mboxdriver : NIL;
}

In routine mbox_open(), change the lines:
				/* open mailbox, snarf new mail */
  if (!(unix_open (stream) && mbox_ping (stream))) return NIL;
to be:
				/* create mbox if doesn't exist */
  if (stat (tmp)) unix_create (NIL,"mbox");
				/* open mailbox, snarf new mail */
  if (!(unix_open (stream) && mbox_ping (stream))) return NIL;