diff -r -c -P procmail-3.22/config.h procmail-3.22-local/src/config.h *** procmail-3.22/config.h Tue Sep 11 00:53:50 2001 --- procmail-3.22-local/src/config.h Mon Oct 18 16:56:34 2004 *************** *** 235,240 **** --- 235,246 ---- #define MAILDIRLEN STRLEN(MAILDIRnew) #define MAILDIRretries 5 /* retries on obtaining a unique filename */ + #define FORCE_MAILDIR /* prefer Maildir over MH */ + #define MAILDIR_DEFAULT /* make maildir the default for new folder + creations */ + #define MAILDIR_SHORTNAME /* use the short hostname as in the + maildir filename */ + #define EOFName " \t\n#`'\");" #define HELPOPT1 'h' /* options to get command line help */ diff -r -c -P procmail-3.22/src/exopen.c procmail-3.22-local/src/src/exopen.c *** procmail-3.22/src/exopen.c Tue Sep 11 00:56:58 2001 --- procmail-3.22-local/src/src/exopen.c Mon Oct 18 16:56:34 2004 *************** *** 86,92 **** --- 86,105 ---- else host=1+ultoan((unsigned long)t,dot+1); /* _pid%time.hostname */ host[-1]='.'; /* add the ".hostname" part */ + #ifndef MAILDIR_SHORTNAME strlcpy(host,safehost(),end-host); + #else + { + char *tmphost; + char *jj; + tmphost = strdup(safehost()); + if ( jj = strstr( tmphost, "." ) ) { + *jj = '\0'; + } + strlcpy(host, tmphost, end-host); + free(tmphost); + } + #endif } *dot=(flags&doMAILDIR)?'0'+serial:s2c[serial]; serial++; diff -r -c -P procmail-3.22/src/foldinfo.c procmail-3.22-local/src/src/foldinfo.c *** procmail-3.22/src/foldinfo.c Tue Sep 11 00:57:32 2001 --- procmail-3.22-local/src/src/foldinfo.c Mon Oct 18 18:34:09 2004 *************** *** 129,135 **** --- 129,139 ---- else if(mode=stbuf.st_mode,!S_ISDIR(mode)) goto file; } + #ifdef FORCE_MAILDIR + type=ft_MAILDIR; i=MAILDIRLEN; + #else type=ft_DIR; + #endif break; default: /* "this cannot happen" */ nlog("Internal error: improper type ("); *************** *** 155,161 **** --- 159,184 ---- goto ret; } if(!mode) + #ifndef MAILDIR_DEFAULT newfile:mode=S_IFREG|NORMperm&~cumask; + #else + newfile: + type = ft_MAILDIR; + forcedir = 1; + chp=strchr(buf, '\0'); + if ((chp-buf)+UNIQnamelen+1+i>linebuf) + { + type=ft_TOOLONG; + goto ret; + } + if (paranoid) + memcpy(buf2, buf, i=lastdirsep(buf)-buf),buf2[i]='\0'; + mode=trymkdir(buf,paranoid!=0,i); + if ( ! mkmaildir(buf, chp, paranoid) ) { + nlog("Unable to create maildir"); + } + goto done; + #endif file:type=ft_FILE; } done: *************** *** 171,176 **** --- 194,200 ---- int screenmailbox(chp,egid,Deliverymode) char*chp;const gid_t egid;const int Deliverymode; { char ch;struct stat stbuf;int basetype,type; + char buffer[DEFlinebuf]; /* * do we need sgidness to access the mail-spool directory/files? */ *************** *** 279,284 **** --- 303,311 ---- } } nobox: + #ifdef MAILDIR_DEFAULT + mkmaildir(buffer, chp, 0); + #else if(!(accspooldir&1)) /* recipient does not own the spool dir */ { if(!xcreat(buf,NORMperm,(time_t*)0,doCHOWN|doCHECK)) /* create */ break; /* mailbox... yes we could, fine, proceed */ *************** *** 288,293 **** --- 315,321 ---- setids(); /* try some magic */ if(!xcreat(buf,NORMperm,(time_t*)0,doCHECK)) /* try again */ break; + #endif if(lstat(buf,&stbuf)) /* nothing in the way? */ fishy: { nlog("Couldn't create");logqnl(buf);