diff -ur imap-2002-dist/src/osdep/unix/Makefile imap-2002/src/osdep/unix/Makefile --- imap-2002-dist/src/osdep/unix/Makefile Mon Oct 14 17:45:24 2002 +++ imap-2002/src/osdep/unix/Makefile Tue Nov 26 12:14:16 2002 @@ -886,6 +886,8 @@ $(LN) sig_$(SIGTYPE).c siglocal.c $(LN) crx_$(CRXTYPE).c crexcl.c sh -c '(test -f /usr/include/sys/statvfs.h -a $(OS) != sc5 -a $(OS) != sco) && $(LN) nfstnew.c nfstest.c || $(LN) nfstold.c nfstest.c' + echo "-I/opt/include" >>OSCFLAGS + echo "-L/opt/lib -lmailpath" >>LDFLAGS # Password checkers diff -ur imap-2002-dist/src/osdep/unix/env_unix.c imap-2002/src/osdep/unix/env_unix.c --- imap-2002-dist/src/osdep/unix/env_unix.c Wed Oct 30 11:55:54 2002 +++ imap-2002/src/osdep/unix/env_unix.c Tue Nov 26 12:13:27 2002 @@ -21,6 +21,7 @@ #include #include #include +#include /* c-client environment parameters */ @@ -792,9 +793,20 @@ char *sysinbox () { char tmp[MAILTMPLEN]; + char *env_inbox, *env_mailpath, *path; if (!sysInbox) { /* initialize if first time */ - sprintf (tmp,"%s/%s",MAILSPOOL,myusername ()); - sysInbox = cpystr (tmp); /* system inbox is from mail spool */ + if (env_inbox = getenv("INBOX")) { + sysInbox = cpystr (env_inbox); /* system inbox is from mail spool */ + } else if (env_mailpath = getenv("MAILPATH_FMT")) { + path = mailpath(env_mailpath, myusername(), MP_NOUID, MP_NOLOOKUP); + if (path) + sysInbox = cpystr(path); + } + + if (!sysInbox) { + sprintf (tmp,"%s/%s",MAILSPOOL,myusername ()); + sysInbox = cpystr (tmp); /* system inbox is from mail spool */ + } } return sysInbox; }