2c5869
--- procmail-3.22.orig/examples/advanced
2c5869
+++ procmail-3.22/examples/advanced
2c5869
@@ -251,14 +251,14 @@
2c5869
    --------------------------------------------------------
2c5869
 
2c5869
 There are many different reasons why more and more sites decide not to
2c5869
-store mail in /usr/spool/mail or /usr/mail anymore.
2c5869
+store mail in /var/spool/mail or /var/mail anymore.
2c5869
 Some of the obvious advantages when storing mail in the recipient's home
2c5869
 directory are:
2c5869
 	- Mail is automatically subject to the user's quota limitations.
2c5869
 	- Often there is more room on the home partition(s) than on that
2c5869
-	  one /usr/mail partition.
2c5869
+	  one /var/mail partition.
2c5869
 
2c5869
-The quota limitations also apply to /usr/spool/mail or /usr/mail if procmail
2c5869
+The quota limitations also apply to /var/spool/mail or /var/mail if procmail
2c5869
 does the delivery.  These quota limitations often do not work with the
2c5869
 regular /bin/mail since that usually writes the mailbox with root permissions
2c5869
 (eluding the quota restrictions).
2c5869
@@ -276,7 +276,7 @@
2c5869
 	defined SYSTEM_MBOX to be.  Some braindamaged mail programs
2c5869
 	do not pick up the MAIL environment variable, these either
2c5869
 	have to be patched/recompiled or you have to create symbolic
2c5869
-	links in /usr/mail to every person's new mailbox.
2c5869
+	links in /var/mail to every person's new mailbox.
2c5869
 
2c5869
 				---
2c5869
 
2c5869
--- procmail-3.22.orig/man/procmail.man
2c5869
+++ procmail-3.22/man/procmail.man
2c5869
@@ -166,7 +166,8 @@
2c5869
 accept an unlimited number of arguments.@ETCRCS_desc@
2c5869
 For some advanced usage of this option you should look in the
2c5869
 .B EXAMPLES
2c5869
-section below.@LMTPOPTdesc@.SH ARGUMENTS
2c5869
+section below.@LMTPOPTdesc@
2c5869
+.SH ARGUMENTS
2c5869
 Any arguments containing an '=' are considered to be environment variable
2c5869
 assignments, they will
2c5869
 .I all
2c5869
@@ -723,6 +724,15 @@
2c5869
 .fi
2c5869
 .ad
2c5869
 .PP
2c5869
+Some mailers (notably exim) do not currently accept the above syntax.
2c5869
+In such case use this instead:
2c5869
+.PP
2c5869
+.na
2c5869
+.nf
2c5869
+|/usr/bin/procmail
2c5869
+.fi
2c5869
+.ad
2c5869
+.PP
2c5869
 Procmail can also be invoked to postprocess an already filled system
2c5869
 mailbox.  This can be useful if you don't want to or can't use a
2c5869
 $HOME/@DOT_FORWARD@ file (in which case the following script could
2c5869
@@ -754,7 +764,7 @@
2c5869
 .SS "A sample small @PROCMAILRC@:"
2c5869
 .na
2c5869
 .nf
2c5869
-PATH=/bin:/usr/bin:@BINDIR@
2c5869
+PATH=/usr/local/bin:/usr/bin:/bin
2c5869
 MAILDIR=$HOME/Mail      #you'd better make sure it exists
2c5869
 DEFAULT=$MAILDIR/mbox   #completely optional
2c5869
 LOGFILE=$MAILDIR/from   #recommended
2c5869
--- procmail-3.22.orig/man/procmailrc.man
2c5869
+++ procmail-3.22/man/procmailrc.man
2c5869
@@ -779,7 +779,7 @@
2c5869
 .PP
2c5869
 Some non-optimal and non-obvious regexps set MATCH to an incorrect
2c5869
 value.  The regexp can be made to work by removing one or more unneeded
2c5869
-'*', '+', or '?' operator on the left-hand side of the \e/ token.
2c5869
+\&'*', '+', or '?' operator on the left-hand side of the \e/ token.
2c5869
 .SH MISCELLANEOUS
2c5869
 If the regular expression contains `\fB@TO_key@\fP' it will be substituted by
2c5869
 .na
2c5869
--- procmail-3.22.orig/src/comsat.c
2c5869
+++ procmail-3.22/src/comsat.c
2c5869
@@ -92,7 +92,7 @@
2c5869
    }
2c5869
   if(newvalid)						  /* so far, so good */
2c5869
    { int s;
2c5869
-     if(!*chp)						       /* no service */
2c5869
+     if(!chad||!*chp)					       /* no service */
2c5869
 	chp=BIFF_serviceport;				/* new balls please! */
2c5869
      s=strtol(chp,&chad,10);
2c5869
      if(chp!=chad)			       /* the service is not numeric */
2c5869
@@ -120,7 +120,7 @@
2c5869
 { int s;const char*p;
2c5869
   if(!csvalid||!buf)		  /* is comat on and set to a valid address? */
2c5869
      return;
2c5869
-  if(!*cslgname||strlen(cslgname)+2>linebuf)	       /* is $LOGNAME bogus? */
2c5869
+  if(!cslgname||!*cslgname||strlen(cslgname)+2>linebuf)/* is $LOGNAME bogus? */
2c5869
      return;
2c5869
   if(!(p=folder?folder:cslastf))		     /* do we have a folder? */
2c5869
      return;
2c5869
--- procmail-3.22.orig/src/formail.c
2c5869
+++ procmail-3.22/src/formail.c
2c5869
@@ -758,9 +758,9 @@
2c5869
 	lputssn(buf,buffilled),ctlength-=buffilled,buffilled=lnl=0;
2c5869
      ;{ int tbl=buflast,lwr='\n';
2c5869
 	while(--ctlength>=0&&tbl!=EOF)	       /* skip Content-Length: bytes */
2c5869
-	   lnl=lwr==tbl&&lwr=='\n',putcs(lwr=tbl),tbl=getchar();
2c5869
+	   lnl=lwr==tbl&&lwr=='\n',lputcs(lwr=tbl),tbl=getchar();
2c5869
 	if((buflast=tbl)=='\n'&&lwr!=tbl)	/* just before a line break? */
2c5869
-	   putcs('\n'),buflast=getchar();		/* wrap up loose end */
2c5869
+	   lputcs('\n'),buflast=getchar();		/* wrap up loose end */
2c5869
       }
2c5869
      if(!quiet&&ctlength>0)
2c5869
       { charNUM(num,ctlength);
2c5869
--- procmail-3.22.orig/src/memblk.c
2c5869
+++ procmail-3.22/src/memblk.c
2c5869
@@ -51,11 +51,11 @@
2c5869
 {
2c5869
 #ifdef USE_MMAP
2c5869
   if(mb->fd>=0)
2c5869
-   { long len=mb->len+1;
2c5869
-     if(munmap(mb->p,len))
2c5869
-	mmapfailed(len);		      /* don't want to continue here */
2c5869
-     if((mb->p=mmap(0,len,PROT_READ,MAP_PRIVATE,mb->fd,(off_t)0))==MAP_FAILED)
2c5869
-	mmapfailed(len);
2c5869
+   { long mlen=mb->len+1;
2c5869
+     if(munmap(mb->p,mlen))
2c5869
+	mmapfailed(mlen);		      /* don't want to continue here */
2c5869
+     if((mb->p=mmap(0,mlen,PROT_READ,MAP_PRIVATE,mb->fd,(off_t)0))==MAP_FAILED)
2c5869
+	mmapfailed(mlen);
2c5869
      close(mb->fd);
2c5869
      mb->fd=ropen(devnull,O_RDWR,0);		/* XXX Perhaps -1 is better? */
2c5869
    }
2c5869
@@ -77,8 +77,8 @@
2c5869
      strcpy(filename,MMAP_DIR);
2c5869
      if(unique(filename,strchr(filename,'\0'),MMAP_FILE_LEN,MMAP_PERM,0,0)&&
2c5869
 	(mb->fd=ropen(filename,O_RDWR,MMAP_PERM),unlink(filename),mb->fd>=0))
2c5869
-      { mb->filelen=len;
2c5869
-	if(lseek(mb->fd,mb->filelen-1,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
2c5869
+      { mb->filelen=len+1;
2c5869
+	if(lseek(mb->fd,len,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
2c5869
 dropf:	 { close(mb->fd);mb->fd= -1;
2c5869
 	   if(verbose)nlog("Unable to extend or use tempfile");
2c5869
 	 }
2c5869
@@ -98,9 +98,9 @@
2c5869
       }
2c5869
    }
2c5869
   if(mb->fd>=0)
2c5869
-   { if(len>mb->filelen)				  /* need to extend? */
2c5869
-      { mb->filelen=len;
2c5869
-	if(lseek(mb->fd,mb->filelen-1,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
2c5869
+   { if(len>=mb->filelen)				  /* need to extend? */
2c5869
+      { mb->filelen=len+1;
2c5869
+	if(lseek(mb->fd,len,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
2c5869
 	 { char*p=malloc(len+1);	   /* can't extend, switch to malloc */
2c5869
 	   tmemmove(p,mb->p,mb->len);
2c5869
 	   munmap(mb->p,mb->len+1);
2c5869
@@ -124,9 +124,9 @@
2c5869
    }
2c5869
   else
2c5869
      mb->p=realloc(mb->p,len+1);
2c5869
-  mb->len=len+1;
2c5869
-  mb->p[len]='\0';
2c5869
+  mb->len=len;
2c5869
 ret1:
2c5869
+  mb->p[len]='\0';
2c5869
   return 1;
2c5869
 }
2c5869
 
2c5869
--- procmail-3.22.orig/src/autoconf
2c5869
+++ procmail-3.22/src/autoconf
2c5869
@@ -1470,15 +1470,14 @@
2c5869
  grep 'Mlocal.*procmail' >$DEVNULL ||
2c5869
  echo '#define CF_no_procmail_yet' >>$ACONF
2c5869
 
2c5869
-cat /usr/lib/sendmail.cf /etc/sendmail.cf /etc/mail/sendmail.cf 2>$DEVNULL |
2c5869
- grep '^V' >$DEVNULL ||
2c5869
- echo '#define buggy_SENDMAIL' >>$ACONF
2c5869
+# cat /usr/lib/sendmail.cf /etc/sendmail.cf /etc/mail/sendmail.cf 2>$DEVNULL |
2c5869
+#  grep '^V' >$DEVNULL ||
2c5869
+#  echo '#define buggy_SENDMAIL' >>$ACONF
2c5869
 
2c5869
 lpath='/bin'
2c5869
 bins="/bin"
2c5869
 
2c5869
-for newd in /usr/bin /usr/ucb /usr/5bin $BINDIR /local/bin /usr/local/bin \
2c5869
- /global/bin /usr/bin/X11 /usr/X*/bin
2c5869
+for newd in /usr/bin $BINDIR /usr/bin/X11 /usr/X*/bin
2c5869
 do
2c5869
   if test -d $newd
2c5869
   then
2c5869
--- procmail-3.22.orig/src/procmail.c
2c5869
+++ procmail-3.22/src/procmail.c
2c5869
@@ -652,8 +652,7 @@
2c5869
 	      nrcond= -1;
2c5869
 	   if(tolock)		 /* clear temporary buffer for lockfile name */
2c5869
 	      free(tolock);
2c5869
-	   for(i=maxindex(flags);i;i--)			  /* clear the flags */
2c5869
-	      flags[i]=0;
2c5869
+	   bbzero(flags,sizeof(flags));		  /* clear the flags */
2c5869
 	   for(tolock=0,locknext=0;;)
2c5869
 	    { chp=skpspace(chp);
2c5869
 	      switch(i= *chp++)
2c5869
--- procmail-3.22.orig/src/pipes.c
2c5869
+++ procmail-3.22/src/pipes.c
2c5869
@@ -145,7 +145,9 @@
2c5869
   if(Stdout)
2c5869
    { *(eq=strchr(Stdout,'\0')-1)='\0';			     /* chop the '=' */
2c5869
      if(!(backblock=getenv(Stdout)))			/* no current value? */
2c5869
-	PRDB=PWRB= -1;
2c5869
+      { PRDB=PWRB= -1;
2c5869
+	backlen=0;
2c5869
+      }
2c5869
      else
2c5869
       { backlen=strlen(backblock);
2c5869
 	goto pip;
2c5869
@@ -155,9 +157,7 @@
2c5869
 pip: rpipe(pbackfd);
2c5869
   rpipe(pinfd);						 /* main pipes setup */
2c5869
   if(!(pidchild=sfork()))			/* create a sending procmail */
2c5869
-   { if(Stdout&&backblock)
2c5869
-	backlen=strlen(backblock);
2c5869
-     else
2c5869
+   { if(!Stdout)
2c5869
 	backblock=source,backlen=len;
2c5869
      childsetup();rclose(PRDI);rclose(PRDB);
2c5869
      rpipe(poutfd);rclose(STDOUT);
2c5869
@@ -194,7 +194,7 @@
2c5869
      makeblock(&temp,Stdfilled);
2c5869
      tmemmove(temp.p,Stdout,Stdfilled);
2c5869
      readdyn(&temp,&Stdfilled,Stdfilled+backlen+1);
2c5869
-     Stdout=realloc(Stdout,&Stdfilled+1);
2c5869
+     Stdout=realloc(Stdout,Stdfilled+1);
2c5869
      tmemmove(Stdout,temp.p,Stdfilled+1);
2c5869
      freeblock(&temp);
2c5869
      retStdout(Stdout,pwait&&pipw,!backblock);
2c5869
--- procmail-3.22.orig/src/memblk.h
2c5869
+++ procmail-3.22/src/memblk.h
2c5869
@@ -1,6 +1,6 @@
2c5869
 typedef struct memblk {
2c5869
     char*p;						  /* where it starts */
2c5869
-    long len;					 /* currently allocated size */
2c5869
+    long len;			 /* current size, not including trailing NUL */
2c5869
 #ifdef USE_MMAP
2c5869
     off_t filelen;				     /* how long is the file */
2c5869
     int fd;					   /* file which is mmap()ed */
2c5869
--- procmail-3.22.orig/src/manconf.c
2c5869
+++ procmail-3.22/src/manconf.c
2c5869
@@ -233,7 +233,7 @@
2c5869
  \2-@PRESERVOPT@\1and\1.BR \2-@FROMWHOPT@ .\1");
2c5869
   pc("LMTPOPT",LMTPOPT);
2c5869
 #else
2c5869
-  ps("LMTPOPTdesc","");ps("LMTPusage","");
2c5869
+  ps("LMTPOPTdesc","");ps("LMTPusage","\1");
2c5869
 #endif
2c5869
   pname("INIT_UMASK",0);printf("0%lo/g\n",(unsigned long)INIT_UMASK);lines--;
2c5869
   pn("DEFlinebuf",DEFlinebuf);
2c5869
--- procmail-3.22.orig/src/recommend.c
2c5869
+++ procmail-3.22/src/recommend.c
2c5869
@@ -47,7 +47,7 @@
2c5869
      printf("chmod %lo %s\n",(unsigned long)(sgid|PERMIS),argv[2]);
2c5869
   else if(chmdir==1)
2c5869
      goto nogchmod;
2c5869
-  if(chmdir)
2c5869
+  if(0)
2c5869
      printf("chmod %c+w %s/.\n",chmdir==1?'g':'a',mailspooldir);
2c5869
 nogchmod:
2c5869
   return EXIT_SUCCESS;
2c5869
--- procmail-3.22.orig/src/foldinfo.h
2c5869
+++ procmail-3.22/src/foldinfo.h
2c5869
@@ -10,7 +10,7 @@
2c5869
 
2c5869
 #define ft_lock(type)	   ((type)>ft_MAILDIR)		   /* kernel lock fd */
2c5869
 #define ft_atime(type)	   ((type)==ft_FILE)	      /* force atime < mtime */
2c5869
-#define ft_dotlock(type)   ((type)==ft_FILE)		 /* dotlock $DEFAULT */
2c5869
+#define ft_dotlock(type)   ((type)>ft_MAILDIR)		 /* dotlock $DEFAULT */
2c5869
 #define ft_delim(type)	   ((type)==ft_FILE)		   /* add MMDF delim */
2c5869
 #define ft_checkcloser(type) ((type)>ft_MH)
2c5869
 #define ft_forceblank(type) ((type)!=ft_MAILDIR)  /* force blank line at end */
2c5869
--- procmail-3.22.orig/src/mailfold.c
2c5869
+++ procmail-3.22/src/mailfold.c
2c5869
@@ -378,7 +378,8 @@
2c5869
 	dfilled=mailread=0;
2c5869
      else if(rhead)				/* only read in a new header */
2c5869
       { memblk new;
2c5869
-	dfilled=mailread=0;makeblock(&new,0);readdyn(&new,&dfilled,0);
2c5869
+	dfilled=mailread=0;makeblock(&new,0);
2c5869
+	readdyn(&new,&dfilled,thebody-themail.p);
2c5869
 	if(tobesent>dfilled&&isprivate)		     /* put it in place here */
2c5869
 	 { tmemmove(themail.p+dfilled,thebody,filled-=tobesent);
2c5869
 	   tmemmove(themail.p,new.p,dfilled);
2c5869
--- procmail-3.22.orig/FAQ
2c5869
+++ procmail-3.22/FAQ
2c5869
@@ -57,8 +57,8 @@
2c5869
 		Forward to |/usr/bin/procmail
2c5869
 	or if that doesn't work, try:
2c5869
 		Pipe to /usr/bin/procmail
2c5869
-	as the only line in your mail spool file (e.g. /usr/mail/$LOGNAME), as
2c5869
-	well as doing a "chmod 06660 /usr/mail/$LOGNAME".  For more information
2c5869
+	as the only line in your mail spool file (e.g. /var/mail/$LOGNAME), as
2c5869
+	well as doing a "chmod 06660 /var/mail/$LOGNAME".  For more information
2c5869
 	on such systems, do a "man mail".
2c5869
 
2c5869
 	If all of this doesn't work, procmail can be called on a periodical
2c5869
@@ -210,14 +210,14 @@
2c5869
 	procmail with both the fcntl() and lockf() locking method
2c5869
 	disabled (see config.h).
2c5869
 
2c5869
-17. I sometimes get these `Lock failure on "/usr/mail/$LOGNAME.lock"' errors
2c5869
+17. I sometimes get these `Lock failure on "/var/mail/$LOGNAME.lock"' errors
2c5869
     from procmail.  What do I do about it?
2c5869
 
2c5869
 	The problem here is that as long as procmail has not read a
2c5869
 	$HOME/.procmailrc file, it can hang on to the sgid mail permission
2c5869
-	(which it needs in order to create a lockfile in /usr/mail).
2c5869
+	(which it needs in order to create a lockfile in /var/mail).
2c5869
 	I.e. if procmail delivers mail to a user without a $HOME/.procmailrc
2c5869
-	file, procmail *can* (and does) use the /usr/mail/$LOGNAME.lock file.
2c5869
+	file, procmail *can* (and does) use the /var/mail/$LOGNAME.lock file.
2c5869
 
2c5869
 	If, however, it finds a $HOME/.procmailrc file, procmail has to let go
2c5869
 	of the sgid mail permission because otherwise any ordinary user could
2c5869
@@ -226,7 +226,7 @@
2c5869
 	There are several solutions to this problem:
2c5869
 	- Some systems support the sticky bit on directories (when set only
2c5869
 	  allows the owner of a file in that directory to rename or remove
2c5869
-	  it).	This enables you to make /usr/spool/mail drwxrwxrwt.  It is
2c5869
+	  it).	This enables you to make /var/mail drwxrwxrwt.  It is
2c5869
 	  thus effectively world writable, but all the mailboxes in it are
2c5869
 	  protected because only the mailbox owner can remove or rename it.
2c5869
 	- If your system did not exhibit the !@#$%^&* POSIX semantics for
2c5869
@@ -245,9 +245,9 @@
2c5869
 			:0
2c5869
 			$DEFAULT
2c5869
 
2c5869
-	- You could, instead of using /usr/mail/$LOGNAME, use a file below
2c5869
+	- You could, instead of using /var/mail/$LOGNAME, use a file below
2c5869
 	  your home directory as your default mailbox.
2c5869
-	- Or, you could still use /usr/mail/$LOGNAME as the mailbox, but
2c5869
+	- Or, you could still use /var/mail/$LOGNAME as the mailbox, but
2c5869
 	  simply instruct procmail to use a different lockfile.	 This can
2c5869
 	  be achieved by putting following recipe at the bottom of
2c5869
 	  your .procmailrc file:
2c5869
--- procmail-3.22.orig/Makefile
2c5869
+++ procmail-3.22/Makefile
2c5869
@@ -79,7 +79,7 @@
2c5869
 #			-lresolv	# not really needed, is it?
2c5869
 
2c5869
 # Informal list of directories where we look for the libraries in SEARCHLIBS
2c5869
-LIBPATHS=/lib /usr/lib /usr/local/lib
2c5869
+LIBPATHS=/lib /usr/lib
2c5869
 
2c5869
 GCC_WARNINGS = -O2 -pedantic -Wreturn-type -Wunused -Wformat -Wtraditional \
2c5869
  -Wpointer-arith -Wconversion -Waggregate-return \
2c5869
--- procmail-3.22.orig/debian/changelog
2c5869
+++ procmail-3.22/debian/changelog
2c5869
@@ -0,0 +1,294 @@
2c5869
+procmail (3.22-8) unstable; urgency=low
2c5869
+
2c5869
+  * Fixed strange formail -l behaviour when there is a Content-Length: header.
2c5869
+    Thanks a lot to Henning Makholm for the patch (Closes: #217853).
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Mon,  3 Nov 2003 20:01:24 +0100
2c5869
+
2c5869
+procmail (3.22-7) unstable; urgency=low
2c5869
+
2c5869
+  * Fixed bad nroff syntax in procmailrc(5), closes: #147173.
2c5869
+  * Added missing newline in procmail(1), closes: #180477.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Mon, 10 Mar 2003 00:09:20 +0100
2c5869
+
2c5869
+procmail (3.22-6) unstable; urgency=low
2c5869
+
2c5869
+  * Standards-Version: 3.5.8.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Thu, 26 Dec 2002 18:27:08 +0100
2c5869
+
2c5869
+procmail (3.22-5) stable; urgency=medium
2c5869
+
2c5869
+  * Patched pipes.c to fix a memory allocation bug (Closes: #171514).
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Thu, 26 Dec 2002 18:09:38 +0100
2c5869
+
2c5869
+procmail (3.22-4) unstable; urgency=low
2c5869
+
2c5869
+  * Fixed a typo in procmail(1). Patch by the author (Closes: #142983).
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Tue, 16 Apr 2002 19:16:20 +0200
2c5869
+
2c5869
+procmail (3.22-3) unstable; urgency=medium
2c5869
+
2c5869
+  * Fixed off-by-one bug in procmail.c which made the raw flag not to be
2c5869
+    cleared properly. Thanks to Gregory Stark (Closes: #134341).
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Sun, 17 Feb 2002 16:43:02 +0100
2c5869
+
2c5869
+procmail (3.22-2) unstable; urgency=medium
2c5869
+
2c5869
+  * Modified mailfold.c to fix a segfault problem. Patch by the author.
2c5869
+  * The system-wide mail directory is /var/mail as per policy.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Thu, 29 Nov 2001 09:39:04 +0100
2c5869
+
2c5869
+procmail (3.22-1) unstable; urgency=low
2c5869
+
2c5869
+  * New upstream release, which uses the `standard' format for Maildir
2c5869
+    filenames and retries on name collision. It also contains some
2c5869
+    bug fixes from the 3.23pre snapshot dated 2001-09-13.
2c5869
+  * Removed `sendmail' from the Recommends field, since we already
2c5869
+    have `exim' (the default Debian MTA) and `mail-transport-agent'.
2c5869
+  * Removed suidmanager support. Conflicts: suidmanager (<< 0.50).
2c5869
+  * Added support for DEB_BUILD_OPTIONS in the source package.
2c5869
+  * README.Maildir: Do not use locking on the example recipe,
2c5869
+    since it's wrong to do so in this case.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Wed, 21 Nov 2001 09:40:20 +0100
2c5869
+
2c5869
+procmail (3.15.2-1) stable; urgency=high
2c5869
+
2c5869
+  * New upstream release, with improved security and robustness involving
2c5869
+    signal handlers. Author recommends upgrading to this version on
2c5869
+    any system where it is installed setuid or setgid.
2c5869
+  * This release fixes also Bug #108417: procmail -p -m resets PATH.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Thu, 30 Aug 2001 20:05:06 +0200
2c5869
+
2c5869
+procmail (3.15.1-4) unstable; urgency=low
2c5869
+
2c5869
+  * Don't add an extra newline when delivering to a Maildir folder.
2c5869
+    Please note that the MTA may still add a newline on their own.
2c5869
+    Exim users should check the `suffix' variable, for example.
2c5869
+    Patch by the author. Closes: #78623.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Sat, 14 Apr 2001 17:18:29 +0200
2c5869
+
2c5869
+procmail (3.15.1-3) unstable; urgency=low
2c5869
+
2c5869
+  * Clarified formail -X behaviour, patch by the author (Closes: #77388).
2c5869
+  * Updated QuickStart.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Sun, 25 Mar 2001 10:45:56 +0200
2c5869
+
2c5869
+procmail (3.15.1-2) unstable; urgency=low
2c5869
+
2c5869
+  * Fixed lockfile -l endless loop (Closes: #82006). Patch by the author.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Sun, 28 Jan 2001 19:44:49 +0100
2c5869
+
2c5869
+procmail (3.15.1-1) unstable; urgency=low
2c5869
+
2c5869
+  * New upstream release. A race to create the mailspool would bounce one of
2c5869
+    the messages due to an internal error.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Mon,  8 Jan 2001 20:09:34 +0100
2c5869
+
2c5869
+procmail (3.15-3) unstable; urgency=low
2c5869
+
2c5869
+  * Fixed formatting error in procmailrc(5). Patch by the author.
2c5869
+    (Closes: #80437).
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Sun, 31 Dec 2000 17:20:47 +0100
2c5869
+
2c5869
+procmail (3.15-2) unstable; urgency=low
2c5869
+
2c5869
+  * formail -l is now documented. Patch by the author (Closes: #72275).
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Fri,  1 Dec 2000 19:54:22 +0100
2c5869
+
2c5869
+procmail (3.15-1) unstable; urgency=low
2c5869
+
2c5869
+  * New upstream release. Maildir support is now built-in.
2c5869
+  * Really change default PATH to "$HOME/bin:/usr/local/bin:/usr/bin:/bin".
2c5869
+  * Modified the note in QuickStart about refiltering an old mail folder.
2c5869
+  * Use SEARCHLIBS="" in debian/rules clean target to speed it up.
2c5869
+  * Modified ft_dotlock in src/foldinfo.h to be in compliance with
2c5869
+    locking policy, following a hint by the author.
2c5869
+  * Removed (versioned) dependency on debianutils, since mailstat
2c5869
+    does not use temporary files anymore.
2c5869
+  * Made the .forward example in procmail(1) not to depend on the build
2c5869
+    environment by modifying src/autoconf so that buggy_SENDMAIL is
2c5869
+    never defined.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Mon, 28 Aug 2000 12:51:05 +0200
2c5869
+
2c5869
+procmail (3.13.1-4) stable; urgency=high
2c5869
+
2c5869
+  * Fixed weird formail -rk behavior (patch from the author, backported
2c5869
+    from procmail-3.15). Thanks to Ben Collins for the report.
2c5869
+  * s/smail/exim/ in `Recommends:' field.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@debian.org>  Tue, 22 Aug 2000 13:04:50 +0200
2c5869
+
2c5869
+procmail (3.13.1-3) unstable; urgency=medium
2c5869
+
2c5869
+  * Standards-Version: 3.1.1
2c5869
+  * Updated location of licenses in copyright file.
2c5869
+  * LOCKINGTEST=100 again, to use fcntl() and dot-locking, as required by
2c5869
+    latest policy.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Wed,  1 Dec 1999 12:37:35 +0100
2c5869
+
2c5869
+procmail (3.13.1-2) unstable; urgency=low
2c5869
+
2c5869
+  * Modified procmail(1) and QuickStart to reflect the fact that exim does
2c5869
+    not accept the exec keyword in .forward files (Bugs #33460 and #37771).
2c5869
+  * Modified formail to recognize exim's Envelope-To: header (Bug#40718).
2c5869
+    Patch by Philip Guenther.
2c5869
+  * Standards-Version: 3.0.0.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Mon, 19 Jul 1999 20:09:25 +0200
2c5869
+
2c5869
+procmail (3.13.1-1) stable unstable; urgency=high
2c5869
+
2c5869
+  * New upstream release, 3.13 missed a couple possible overflows.
2c5869
+  * Applied `procmail-locking.patch' from Bruce Guenter, since
2c5869
+    no directory delivery mechanism requires locking (Bug #35210).
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Thu,  8 Apr 1999 13:56:33 +0200
2c5869
+
2c5869
+procmail (3.13-1) stable unstable; urgency=high
2c5869
+
2c5869
+  * New upstream release. procmail 3.12 breaks smartlist (Bug #35115).
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Fri,  2 Apr 1999 14:24:24 +0200
2c5869
+
2c5869
+procmail (3.12-1) frozen unstable; urgency=high
2c5869
+
2c5869
+  * New upstream release. Fixes some security bugs.
2c5869
+  * #define GROUP_PER_USER in config.h to allow writeable rcfiles when
2c5869
+    the group is the user's default group.
2c5869
+  * Added KNOWN_BUGS to the doc directory.
2c5869
+  * suid procmail to avoid non-suidness window when upgrading.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Thu,  4 Mar 1999 10:28:28 +0100
2c5869
+
2c5869
+procmail (3.10.7-7) frozen unstable; urgency=medium
2c5869
+
2c5869
+  * New Maildir patches from Bruce Guenter.
2c5869
+    Should fix Bug #30320: procmail: maildir does not use From_ lines.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Thu, 31 Dec 1998 13:27:20 +0100
2c5869
+
2c5869
+procmail (3.10.7-6) frozen unstable; urgency=medium
2c5869
+
2c5869
+  * Patched mailfold.c to avoid the unnecessary one second wait when
2c5869
+    delivering to MH folders (patch by the author).
2c5869
+  * src/locking.c: Applied a bugfix patch from the author.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Wed, 13 May 1998 21:50:19 +0200
2c5869
+
2c5869
+procmail (3.10.7-5) frozen unstable; urgency=medium
2c5869
+
2c5869
+  * Added a patch for Maildir support. The "new" procmail should be
2c5869
+    completely backwards compatible with the "previous" one, in the
2c5869
+    sense that its behaviour should be just the same for already
2c5869
+    existing .procmailrc files which do not use the new syntax for
2c5869
+    Maildir folders.
2c5869
+  * Added a small README.Maildir explaining how to use this feature.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Mon,  4 May 1998 19:39:55 +0200
2c5869
+
2c5869
+procmail (3.10.7-4) frozen unstable; urgency=low
2c5869
+
2c5869
+  * Added a small note in QuickStart about refiltering an old mail folder.
2c5869
+  * mailstat(1): The log file is truncated to zero length (Bug #21022).
2c5869
+  * PATH=/usr/local/bin:/usr/bin:/bin for the example in procmail(1).
2c5869
+  * Standards-Version: 2.4.1.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Fri, 17 Apr 1998 18:00:14 +0200
2c5869
+
2c5869
+procmail (3.10.7-3) frozen unstable; urgency=medium
2c5869
+
2c5869
+  * Patched src/recommend.c so that the mail spool directory is not
2c5869
+    touched. This will allow the package to be built using fakeroot.
2c5869
+  * Patched mailstat so that it uses tempfile.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Tue, 24 Mar 1998 21:43:08 +0100
2c5869
+
2c5869
+procmail (3.10.7-2) unstable; urgency=low
2c5869
+
2c5869
+  * Default PATH is now "$HOME/bin:/usr/local/bin:/usr/bin:/bin".
2c5869
+  * Added "fetchmail" to the Recommends: line as one more option.
2c5869
+  * Added /usr/doc/procmail/QuickStart (experimental).
2c5869
+  * Compressed changelog.Debian.
2c5869
+  * Removed debstd dependency.
2c5869
+  * Pristine source.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Sat, 31 Jan 1998 20:30:06 +0100
2c5869
+
2c5869
+procmail (3.10.7-1) unstable; urgency=low
2c5869
+
2c5869
+  * Upgraded to 3.11pre7. Sources are now GPLed, hurrah!
2c5869
+  * Added explicit SEARCHLIBS, to avoid unneeded dependency on libdl.
2c5869
+  * First libc6 release.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Wed, 18 Jun 1997 20:43:28 +0200
2c5869
+
2c5869
+procmail (3.10.4-2) frozen unstable; urgency=low
2c5869
+
2c5869
+  * Rebuilt using latest debmake to avoid a problem with suidmanager.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Sat, 17 May 1997 20:52:59 +0200
2c5869
+
2c5869
+procmail (3.10.4-1) frozen unstable; urgency=low
2c5869
+
2c5869
+  * Upgraded to 3.11pre4. Side effect: It can be built using libc6.
2c5869
+  * Removed NFS_ATIME_HACK patch, since it is no longer needed.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Sat, 12 Apr 1997 19:06:46 +0200
2c5869
+
2c5869
+procmail (3.10-8) unstable; urgency=low
2c5869
+
2c5869
+  * Rewritten copyright file.
2c5869
+  * initmake unmodified (source).
2c5869
+  * Patched to recognize NFS_ATIME_HACK variable in .procmailrc or
2c5869
+    /etc/procmailrc. Default value is "yes" (i.e. wait a second).
2c5869
+  * Added a small note about this in /usr/doc/procmail/README.Debian.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Sun, 23 Mar 1997 12:04:34 +0100
2c5869
+
2c5869
+procmail (3.10-7) unstable; urgency=low
2c5869
+
2c5869
+  * Put CFLAGS settings &c in ./Makefile, not in debian/rules.
2c5869
+  * Removed fix-substvars script, since it's no longer needed with
2c5869
+    new libc5-5.4.20.
2c5869
+  * Man page for mailstat changed slightly.
2c5869
+  * Some minor debian/rules changes.
2c5869
+  * Added MD5 sums.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Fri, 21 Feb 1997 20:53:30 +0100
2c5869
+
2c5869
+procmail (3.10-6) unstable; urgency=low
2c5869
+
2c5869
+  * Use debmake.
2c5869
+  * suidmanager support.
2c5869
+  * Removed `mailstat' from examples, it's already in /usr/bin.
2c5869
+  * Removed also `dirname' (which was "for the deprived").
2c5869
+  * Added `fix-substvars' script to depend on libc5 >= 5.4.0.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Mon, 23 Dec 1996 16:34:02 +0100
2c5869
+
2c5869
+procmail (3.10-5) unstable; urgency=low
2c5869
+
2c5869
+  * Updated to Standards-Version 2.1.2.2.
2c5869
+  * Changed "Depends: MTA" to "Recommends: MTA".
2c5869
+  * Added extended package description in control file.
2c5869
+  * Added the symlink changelog.gz -> HISTORY.gz.
2c5869
+  * Added an "experimental" man page for mailstat.
2c5869
+  * New maintainer.
2c5869
+
2c5869
+ -- Santiago Vila <sanvila@ctv.es>  Sat, 21 Dec 1996 23:32:11 +0100
2c5869
--- procmail-3.22.orig/debian/control
2c5869
+++ procmail-3.22/debian/control
2c5869
@@ -0,0 +1,18 @@
2c5869
+Source: procmail
2c5869
+Section: mail
2c5869
+Priority: standard
2c5869
+Maintainer: Santiago Vila <sanvila@debian.org>
2c5869
+Standards-Version: 3.6.1
2c5869
+
2c5869
+Package: procmail
2c5869
+Architecture: any
2c5869
+Depends: ${shlibs:Depends}
2c5869
+Conflicts: suidmanager (<< 0.50)
2c5869
+Recommends: exim | mail-transport-agent | fetchmail
2c5869
+Description: Versatile e-mail processor
2c5869
+ Can be used to create mail-servers, mailing lists, sort your incoming
2c5869
+ mail into separate folders/files (real convenient when subscribing to one
2c5869
+ or more mailing lists or for prioritising your mail), preprocess your
2c5869
+ mail, start any programs upon mail arrival (e.g. to generate different
2c5869
+ chimes on your workstation for different types of mail) or selectively
2c5869
+ forward certain incoming mail automatically to someone.
2c5869
--- procmail-3.22.orig/debian/copyright
2c5869
+++ procmail-3.22/debian/copyright
2c5869
@@ -0,0 +1,41 @@
2c5869
+This is the Debian prepackaged version of the "procmail" mail-processing
2c5869
+program written by Stephen van den Berg.
2c5869
+
2c5869
+This package is currently maintained by Santiago Vila <sanvila@debian.org>.
2c5869
+The source for this release was downloaded from:
2c5869
+
2c5869
+ftp://ftp.procmail.org/pub/procmail/procmail-3.22.tar.gz
2c5869
+
2c5869
+This package was first put together by Bruce Perens <bruce@hams.com>,
2c5869
+who added Debian package maintenance system files, and edited config.h
2c5869
+to configure for Debian.
2c5869
+
2c5869
+Copyright:
2c5869
+
2c5869
+Procmail & formail mail processing package.
2c5869
+Copyright (c) 1990-1999, S.R. van den Berg, The Netherlands.
2c5869
+Copyright (c) 1999-2001, Philip Guenther, The United States of America
2c5869
+
2c5869
+This package is open source software; you can redistribute it and/or
2c5869
+modify it under the terms of either:
2c5869
+- the GNU General Public License as published by the Free Software Foundation
2c5869
+  and can be found in the included file called "COPYING"; either version 2,
2c5869
+  or (at your option) any later version, or
2c5869
+- the "Artistic License" which can be found in the included file called
2c5869
+  "Artistic".
2c5869
+
2c5869
+This package is distributed in the hope that it will be useful, but without
2c5869
+any warranty; without even the implied warranty of merchantability or fitness
2c5869
+for a particular purpose.  See either the GNU General Public License or the
2c5869
+Artistic License for more details.
2c5869
+
2c5869
+For those of you that choose to use the GNU General Public License,
2c5869
+my interpretation of the GNU General Public License is that no procmailrc
2c5869
+script falls under the terms of the GPL unless you explicitly put
2c5869
+said script under the terms of the GPL yourself.
2c5869
+
2c5869
+
2c5869
+On Debian systems, the complete text of the GNU General Public License
2c5869
+can be found in `/usr/share/common-licenses/GPL', and the complete
2c5869
+text of the "Artistic License" can be found in
2c5869
+`/usr/share/common-licenses/Artistic'.
2c5869
--- procmail-3.22.orig/debian/mailstat.1
2c5869
+++ procmail-3.22/debian/mailstat.1
2c5869
@@ -0,0 +1,40 @@
2c5869
+.TH MAILSTAT 1
2c5869
+.SH NAME
2c5869
+mailstat \- shows mail-arrival statistics
2c5869
+.SH SYNOPSIS
2c5869
+.B mailstat
2c5869
+[\-klmots] [logfile]
2c5869
+.SH DESCRIPTION
2c5869
+.B mailstat
2c5869
+parses a procmail-generated $LOGFILE and displays
2c5869
+a summary about the messages delivered to all folders
2c5869
+(total size, average size, nr of messages).
2c5869
+The $LOGFILE is truncated to zero length, unless the
2c5869
+.B -k
2c5869
+option is used.
2c5869
+Exit code 0 if mail arrived, 1 if no mail arrived.
2c5869
+.SH OPTIONS
2c5869
+.TP
2c5869
+.I \-k
2c5869
+keep logfile intact
2c5869
+.TP
2c5869
+.I \-l
2c5869
+long display format
2c5869
+.TP
2c5869
+.I \-m
2c5869
+merge any errors into one line
2c5869
+.TP
2c5869
+.I \-o
2c5869
+use the old logfile
2c5869
+.TP
2c5869
+.I \-t
2c5869
+terse display format
2c5869
+.TP
2c5869
+.I \-s
2c5869
+silent in case of no mail
2c5869
+.SH NOTES
2c5869
+Customise to your heart's content, this program is only provided as a
2c5869
+guideline.
2c5869
+.SH AUTHOR
2c5869
+This manual page was written by Santiago Vila <sanvila@debian.org>
2c5869
+for the Debian GNU/Linux distribution (but may be used by others).
2c5869
--- procmail-3.22.orig/debian/QuickStart
2c5869
+++ procmail-3.22/debian/QuickStart
2c5869
@@ -0,0 +1,97 @@
2c5869
+procmail QuickStart
2c5869
+===================
2c5869
+
2c5869
+* procmail is not an `interactive' program. It has to run automatically
2c5869
+when the mail arrives. Therefore the first thing to do is to tell our MTA
2c5869
+that we want procmail to "eat" all our mail messages. The way of doing
2c5869
+this depends on the MTA we are using. For example, if we are using
2c5869
+sendmail, it will suffice to have a .forward file like this in our home
2c5869
+directory:
2c5869
+
2c5869
+"|exec /usr/bin/procmail"
2c5869
+
2c5869
+(don't forget the quotes, they are needed in this case).
2c5869
+
2c5869
+If you are using exim, use this instead as your .forward file:
2c5869
+
2c5869
+|/usr/bin/procmail
2c5869
+
2c5869
+The step of creating a .forward file is not needed if the MTA already
2c5869
+performs the delivery using procmail. For example, Debian sendmail will
2c5869
+automatically use procmail for mail delivering if the sendmail.cf is
2c5869
+generated from a sendmail.mc file containing this line:
2c5869
+
2c5869
+FEATURE(local_procmail)dnl
2c5869
+
2c5869
+
2c5869
+* If we have a stand-alone system with no permanent net connection (like
2c5869
+PPP), and we are using fetchmail to get mail from a server, we don't
2c5869
+really need a MTA.  Just adding  --mda "formail -s procmail"  to the
2c5869
+fetchmail command line (or using the `mda' keyword) will tell it to
2c5869
+deliver through procmail.
2c5869
+
2c5869
+
2c5869
+* Next, we have to write a ~/.procmailrc file in our home directory. This
2c5869
+file is a set of filtering rules, based on regular expressions. The
2c5869
+complete syntax is explained in procmailrc(5). Let's see a real example
2c5869
+just to get started. Let's suppose you are subscribed to the following two
2c5869
+mailing lists:
2c5869
+
2c5869
+linux-kernel@vger.kernel.org
2c5869
+debian-user@lists.debian.org
2c5869
+
2c5869
+The first list is managed by Majordomo. Messages coming from a Majordomo
2c5869
+list often include a header field "Sender: " which allow easy filtering.
2c5869
+
2c5869
+The second list is managed my SmartList. Messages coming from a SmartList
2c5869
+list may include several headers that can be used to filter it. One of
2c5869
+them (in fact, the only that it is not X-whatever) is "Resent-Sender: ".
2c5869
+
2c5869
+So the following .procmailrc will first filter the mailing lists, and
2c5869
+any remaining message will go to the default folder:
2c5869
+
2c5869
+*--------------------------------->8------------------------------------
2c5869
+PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin
2c5869
+MAILDIR=$HOME/mail             # you'd better make sure it exists
2c5869
+DEFAULT=$MAILDIR/mbox          # completely optional
2c5869
+LOGFILE=$MAILDIR/procmail.log  # recommended
2c5869
+
2c5869
+:0:
2c5869
+* ^Sender:.*linux-kernel-owner@vger.kernel.org
2c5869
+linux-kernel
2c5869
+
2c5869
+:0:
2c5869
+* ^Resent-Sender:.*debian-user-request@lists.debian.org
2c5869
+debian-user
2c5869
+*--------------------------------->8------------------------------------
2c5869
+
2c5869
+From this example additional rules for mailing lists may be created
2c5869
+easily.
2c5869
+
2c5869
+
2c5869
+* Once you have received lots of messages you will want to know where
2c5869
+did they go. That's what the LOGFILE is for. There is a tool named
2c5869
+mailstat which parses this file and shows a summary:
2c5869
+
2c5869
+mailstat procmail.log
2c5869
+
2c5869
+The mailstat command that this package provides does really come from the
2c5869
+examples directory and it is installed by default. You may have your own
2c5869
+modified copy in $HOME/bin, if you like.
2c5869
+
2c5869
+
2c5869
+If you have to refilter an old mail folder according to your current
2c5869
+~/.procmailrc file, you may do the following:
2c5869
+
2c5869
+cat mbox | formail -s procmail
2c5869
+
2c5869
+But of course if your mbox file is the target of a procmail recipe you should
2c5869
+do this instead:
2c5869
+
2c5869
+mv mbox whatever
2c5869
+cat whatever | formail -s procmail
2c5869
+
2c5869
+See formail(1) for details.
2c5869
+
2c5869
+
2c5869
+Santiago Vila <sanvila@debian.org>
2c5869
--- procmail-3.22.orig/debian/README.Maildir
2c5869
+++ procmail-3.22/debian/README.Maildir
2c5869
@@ -0,0 +1,12 @@
2c5869
+This version of procmail supports Maildir folders.
2c5869
+
2c5869
+To make procmail to deliver into a Maildir folder, just append
2c5869
+a slash (/) to the name of the maildir folder in your ~/.procmailrc file.
2c5869
+For example, the following rule:
2c5869
+
2c5869
+:0
2c5869
+* ^Resent-Sender.*debian-user-request@lists.debian.org
2c5869
+debian-user/
2c5869
+
2c5869
+will deliver all mail from the debian-user mailing list to the Maildir
2c5869
+folder "debian-user".
2c5869
--- procmail-3.22.orig/debian/rules
2c5869
+++ procmail-3.22/debian/rules
2c5869
@@ -0,0 +1,76 @@
2c5869
+#!/usr/bin/make -f
2c5869
+
2c5869
+package = procmail
2c5869
+docdir = debian/tmp/usr/share/doc/$(package)
2c5869
+
2c5869
+CC = gcc
2c5869
+CFLAGS0 = -g
2c5869
+LDFLAGS0 =
2c5869
+SEARCHLIBS = -lm
2c5869
+STRIP = true
2c5869
+
2c5869
+ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
2c5869
+  CFLAGS0 += -O2
2c5869
+endif
2c5869
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
2c5869
+  STRIP = strip --remove-section=.comment --remove-section=.note
2c5869
+endif
2c5869
+
2c5869
+build:
2c5869
+	$(checkdir)
2c5869
+	$(MAKE) CC="$(CC)" CFLAGS0="$(CFLAGS0)" LDFLAGS0="$(LDFLAGS0)" \
2c5869
+		SEARCHLIBS="$(SEARCHLIBS)"
2c5869
+	touch build
2c5869
+
2c5869
+clean:
2c5869
+	$(checkdir)
2c5869
+	rm -f build
2c5869
+	-$(MAKE) realclean SEARCHLIBS=""
2c5869
+	rm -f `find . -name "*~"`
2c5869
+	rm -rf debian/tmp debian/files* core debian/substvars
2c5869
+
2c5869
+binary-indep: checkroot build
2c5869
+	$(checkdir)
2c5869
+
2c5869
+binary-arch: checkroot build
2c5869
+	$(checkdir)
2c5869
+	rm -rf debian/tmp
2c5869
+	install -d debian/tmp/DEBIAN $(docdir)/examples
2c5869
+	cd debian/tmp && install -d usr/bin
2c5869
+	$(MAKE) BASENAME=`pwd`/debian/tmp/usr install.man install-suid
2c5869
+	$(STRIP) debian/tmp/usr/bin/procmail
2c5869
+	$(STRIP) debian/tmp/usr/bin/lockfile
2c5869
+	$(STRIP) debian/tmp/usr/bin/formail
2c5869
+	cp -p debian/copyright $(docdir)
2c5869
+	cp -p debian/changelog $(docdir)/changelog.Debian
2c5869
+	install -m 644 debian/mailstat.1 debian/tmp/usr/man/man1
2c5869
+	cp -p FEATURES HISTORY README FAQ KNOWN_BUGS \
2c5869
+		debian/QuickStart debian/README.Maildir $(docdir)
2c5869
+	cp -p examples/* $(docdir)/examples
2c5869
+	cd $(docdir)/examples && rm -f dirname mailstat procmail-rpm.spec
2c5869
+	cd $(docdir) && gzip -9 HISTORY changelog.Debian
2c5869
+	ln -s HISTORY.gz $(docdir)/changelog.gz
2c5869
+	mv debian/tmp/usr/man debian/tmp/usr/share
2c5869
+	gzip -r9 debian/tmp/usr/share/man
2c5869
+	dpkg-shlibdeps debian/tmp/usr/bin/*
2c5869
+	dpkg-gencontrol -isp
2c5869
+	cd debian/tmp && \
2c5869
+		md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
2c5869
+	chown -R root:root debian/tmp
2c5869
+	chmod -R go=rX debian/tmp
2c5869
+	chgrp mail debian/tmp/usr/bin/procmail debian/tmp/usr/bin/lockfile
2c5869
+	chmod 6755 debian/tmp/usr/bin/procmail
2c5869
+	chmod 2755 debian/tmp/usr/bin/lockfile
2c5869
+	dpkg --build debian/tmp ..
2c5869
+
2c5869
+define checkdir
2c5869
+        test -f src/$(package).c -a -f debian/rules
2c5869
+endef
2c5869
+
2c5869
+binary: binary-indep binary-arch
2c5869
+
2c5869
+checkroot:
2c5869
+	$(checkdir)
2c5869
+	test root = "`whoami`"
2c5869
+
2c5869
+.PHONY: binary binary-arch binary-indep clean checkroot