--- src/osdep/unix/env_unix.c.orig 2011-07-23 02:20:10.000000000 +0200
+++ src/osdep/unix/env_unix.c 2014-08-29 22:53:25.000000000 +0200
/* in case stat.h is ancient */
static char *myServerName = NIL;/* server name */
static char *myLocalHost = NIL; /* local host name */
static char *myNewsrc = NIL; /* newsrc file name */
-static char *mailsubdir = NIL; /* mailbox subdirectory name */
+static char *mailsubdir = ((char*)-1); /* mailbox subdirectory name */
static char *sysInbox = NIL; /* system inbox name */
static char *newsActive = NIL; /* news active file */
static char *newsSpool = NIL; /* news spool */
char *home = myhomedir ();
/* initialize if first time */
if (!myMailboxDir && myHomeDir) {
+ if (mailsubdir == ((char*)-1) ) {
+ asprintf( &rcfile, "%s/.imap/MailboxDir.rc", home );
+ if( rcfile && (fp = fopen( rcfile, "r" )) ){
+ char dirnm[MAXPATHLEN];
+ if( fgets( dirnm, MAXPATHLEN, fp ) > 0 ){
+ if( dirnm[strlen(dirnm)-1] == '\n' ){
+ dirnm[strlen(dirnm)-1] = '\0';
+ myMailboxDir = cpystr(dirnm);
+ snprintf( dirnm, MAXPATHLEN, "Mailbox dir set to %s", myMailboxDir );
sprintf (tmp,"%s/%s",home,mailsubdir);
myMailboxDir = cpystr (tmp);/* use pre-defined subdirectory of home */