procmail - home_etc.patch

Marcin Sobecki cinek w pld.zsl.gda.pl
Pią, 17 Wrz 2004, 09:42:04 CEST


Witam,
w zalaczniku patch dodajacy obsluge HOME_ETC do procmaila. Nie wiem czy to 
ma rece i nogi wiec jesli ktos bardziej wtajemniczony moglby w to 
zerknac..
A tak swoja droga, w CVS lezy przykladowy .procmailrc, moze jednak by go 
dolaczac do pakietu i wrzucac do /etc/skel?

Pozdrawiam

-- 
Marcin Sobecki
-------------- następna część ---------
diff -burN procmail-3.22.org/config.h procmail-3.22/config.h
--- procmail-3.22.org/config.h	2001-09-11 06:53:50.000000000 +0200
+++ procmail-3.22/config.h	2004-09-16 22:34:07.000000000 +0200
@@ -19,7 +19,7 @@
  * considerations/dependencies present in the use of locales other than
  * the "C" locale.
  */
-#define KEEPENV		{"TZ",0}
+#define KEEPENV		{"TZ","HOME_ETC",0}
 
 /* procmail is compiled with two definitions of the PATH variable.  The first
  * definition is used while processing the /etc/procmailrc file and should
diff -burN procmail-3.22.org/src/procmail.c procmail-3.22/src/procmail.c
--- procmail-3.22.org/src/procmail.c	2001-09-11 06:59:14.000000000 +0200
+++ procmail-3.22/src/procmail.c	2004-09-16 19:48:42.000000000 +0200
@@ -44,10 +44,10 @@
  pmusage[]=PM_USAGE,*etcrc=ETCRC,misrecpt[]="Missing recipient\n",
  extrns[]="Extraneous ",ignrd[]=" ignored\n",pardir[]=chPARDIR,
  defspath[]=DEFSPATH,defmaildir[]=DEFmaildir;
-char*buf,*buf2,*loclock;
+char*buf,*buf2,*loclock,*pmrc=PROCMAILRC;
 const char shell[]="SHELL",lockfile[]="LOCKFILE",newline[]="\n",binsh[]=BinSh,
  unexpeof[]="Unexpected EOL\n",*const*gargv,*const*restargv= &nullp,*sgetcp,
- pmrc[]=PROCMAILRC,*rcfile,dirsep[]=DIRSEP,devnull[]=DevNull,empty[]="",
+ *rcfile,dirsep[]=DIRSEP,devnull[]=DevNull,empty[]="",
  lgname[]="LOGNAME",executing[]="Executing",oquote[]=" \"",cquote[]="\"\n",
  procmailn[]="procmail",whilstwfor[]=" whilst waiting for ",home[]="HOME",
  host[]="HOST",*defdeflock=empty,*argv0=empty,curdir[]={chCURDIR,'\0'},
@@ -477,6 +477,11 @@
    { int rctype;
      if(!rcfile)			    /* no rcfile on the command line */
       { rctype=rct_DEFAULT;
+	if (getenv("HOME_ETC")) {
+	   char buffer[1024];
+	   snprintf(buffer, 1024, "%s/.procmailrc", getenv("HOME_ETC"));
+	   pmrc=buffer;
+	   }
 	if(buildpath("default rcfile",pmrc,(char*)0))
 	   goto nomore_rc;
       }
@@ -524,6 +529,7 @@
 #ifdef USEflock
   elog(", flock()");
 #endif
+  if (getenv("HOME_ETC")) pmrc="$HOME_ETC/.procmailrc";
   elog("\nDefault rcfile:\t\t");elog(pmrc);
 #ifdef GROUP_PER_USER
   elog("\n\tIt may be writable by your primary group");
diff -burN procmail-3.22.org/src/procmail.h procmail-3.22/src/procmail.h
--- procmail-3.22.org/src/procmail.h	2001-09-11 06:59:32.000000000 +0200
+++ procmail-3.22/src/procmail.h	2004-09-16 16:49:08.000000000 +0200
@@ -88,9 +88,9 @@
 /* #define PM_version	(strenstr[8].sval) */
 
 
-extern char*buf,*buf2,*loclock,*thebody;
+extern char*buf,*buf2,*loclock,*thebody,*pmrc;
 extern const char shell[],lockfile[],newline[],binsh[],unexpeof[],*const*gargv,
- *const*restargv,*sgetcp,pmrc[],*rcfile,dirsep[],devnull[],empty[],lgname[],
+ *const*restargv,*sgetcp,*rcfile,dirsep[],devnull[],empty[],lgname[],
  executing[],oquote[],cquote[],whilstwfor[],procmailn[],Mail[],home[],host[],
  *defdeflock,*argv0,exceededlb[],curdir[],slogstr[],conflicting[],orgmail[],
  insufprivs[],defpath[],errwwriting[],Version[];


Więcej informacji o liście dyskusyjnej pld-devel-pl