Sync from SUSE:SLFO:Main procmail revision a78eea846767dba79a5b57540d1ec9a4

This commit is contained in:
Adrian Schröter 2024-05-03 19:37:20 +02:00
commit 94bd9561c0
15 changed files with 1124 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,54 @@
---
src/autoconf | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
--- src/autoconf
+++ src/autoconf 2008-03-04 12:33:44.000000000 +0000
@@ -249,6 +249,7 @@ then
fi
cat >grepfor <<HERE
+#!/bin/sh
$FGREP -e "\$1" _autotst.rrr >$DEVNULL && echo "\$2" >>$ACONF
HERE
chmod 0755 grepfor
@@ -1017,14 +1018,38 @@ cat >_autotst.c <<HERE
#include <pwd.h>
int main()
{ struct passwd*pw=getpwuid(0);
- return (pw->pw_passwd==0)+(pw->pw_class==0)+(pw->pw_gecos==0);
+ return (pw && pw->pw_passwd);
}
HERE
echo 'Testing for various struct passwd members'
$MAKE _autotst.$O >_autotst.rrr 2>&1
grepfor pw_passwd '#define NOpw_passwd'
+$RM _autotst.$O _autotst.rrr
+
+cat >_autotst.c <<HERE
+#include <pwd.h>
+int main()
+{ struct passwd*pw=getpwuid(0);
+ return (pw && pw->pw_class==0);
+}
+HERE
+
+echo 'Testing for various struct passwd members'
+$MAKE _autotst.$O >_autotst.rrr 2>&1
grepfor pw_class '#define NOpw_class'
+$RM _autotst.$O _autotst.rrr
+
+cat >_autotst.c <<HERE
+#include <pwd.h>
+int main()
+{ struct passwd*pw=getpwuid(0);
+ return (pw && pw->pw_gecos==0);
+}
+HERE
+
+echo 'Testing for various struct passwd members'
+$MAKE _autotst.$O >_autotst.rrr 2>&1
grepfor pw_gecos '#define NOpw_gecos'
$RM _autotst.$O _autotst.rrr

View File

@ -0,0 +1,39 @@
---
man/procmail.man | 3 ---
src/fields.c | 13 +++++++++++--
2 files changed, 11 insertions(+), 5 deletions(-)
--- man/procmail.man
+++ man/procmail.man 2004-05-09 22:17:37.000000000 +0000
@@ -605,9 +605,6 @@ it to the filter itself, not to any of t
A continued
.B Content-Length:
field is not handled correctly.
-.PP
-The embedded newlines in a continued header should be skipped when
-matching instead of being treated as a single space as they are now.
.SH MISCELLANEOUS
If there is an existing
.B Content-Length:
--- src/fields.c
+++ src/fields.c 2009-11-20 15:06:37.571429621 +0000
@@ -68,8 +68,17 @@ void concatenate(fldp)struct field*const
l=fldp->Tot_len;
if(!eqFrom_(p=fldp->fld_text)) /* don't concatenate From_ lines */
while(l--)
- if(*p++=='\n'&&l) /* by substituting all newlines except the last */
- p[-1]=' ';
+ if(*p=='\n'&&l) /* by removing all newlines except the last */
+ {
+ *p++=' ';
+ while((*p == ' ' || *p == '\t') && l)
+ {
+ tmemmove(p, p+1, l--);
+ fldp->Tot_len--;
+ }
+ }
+ else
+ p++;
}
static void extractfield(p)register const struct field*p;

228
procmail-3.22-ipv6.patch Normal file
View File

@ -0,0 +1,228 @@
---
src/autoconf | 55 +++++++++-----------------------------------------
src/comsat.c | 63 ++++++++++++++++++----------------------------------------
src/network.h | 10 +--------
3 files changed, 32 insertions(+), 96 deletions(-)
--- src/autoconf
+++ src/autoconf 2006-10-24 12:51:01.000000000 +0000
@@ -68,8 +68,6 @@
# #define NOfsync
#Ok #define endpwent()
#Ok #define endgrent()
-#Ok #define endhostent()
-#Ok #define endservent()
#Ok #define endprotoent()
# #define h_0addr_list h_addr
#Ok #define NOpw_passwd
@@ -897,7 +895,7 @@ int main(){int i=0;
{uid_t vuid_t;i+=vuid_t=1;}
{gid_t vgid_t;i+=vgid_t=1;}
#ifndef NO_COMSAT
- {struct hostent vhostent;i+=!(vhostent.h_addr_list=0);}
+ {struct addrinfo res; i+=!(res.ai_socktype=0);}
#endif
#ifndef NOuname
{struct utsname vutsname;i+=!(*vutsname.nodename='\0');}
@@ -918,8 +916,6 @@ do
test -z "$i3" && grepfor mode_t 'typedef int mode_t;' && i3=I
test -z "$i4" && grepfor uid_t 'typedef int uid_t;' && i4=I
test -z "$i5" && grepfor gid_t 'typedef int gid_t;' && i5=I
- test -z "$i6" && grepfor h_addr_list '#define h_0addr_list h_addr' && i6=I
- test -z "$i6" && grepfor hostent '#define h_0addr_list h_addr' && i6=I
test -z "$i6" && grepfor member '#define h_0addr_list h_addr' && i6=I
test -z "$i7" && grepfor utsname "#define NOuname \
/* <sys/utsname.h> is there, but empty */" && i7=I
@@ -1073,8 +1069,12 @@ int main(){char a[2];
{struct utsname b;uname(&b);}
#endif
#ifndef NO_COMSAT
- gethostbyname("0");getprotobyname(COMSATprotocol);endhostent();endservent();
- endprotoent();
+ {
+ struct addrinfo *res, hints;
+ memset(&hints, '\0', sizeof(hints));
+ if(getaddrinfo(COMSAThost,BIFF_serviceport,&hints,&res))
+ freeaddrinfo(res);
+ }
#endif
_exit(0);
return 0;}
@@ -1128,14 +1128,9 @@ grepfor uname "\
/* <sys/utsname.h> defines it, the libraries don't */"
grepfor endpwent '#define endpwent()'
grepfor endgrent '#define endgrent()'
-if grepfor gethostbyname '#define NO_COMSAT'
+if grepfor getaddrinfo '#define NO_COMSAT'
then
:
-else
- grepfor getprotobyname '#define UDP_protocolno 17'
- grepfor endhostent '#define endhostent()'
- grepfor endservent '#define endservent()'
- grepfor endprotoent '#define endprotoent()'
fi
grepfor strstr '#define SLOWstrstr' ||
grepfor clock '#define SLOWstrstr'
@@ -1264,39 +1259,9 @@ int main(argc,argv)int argc;const char*a
printf("/* Insufficient memory to perform the benchmark! */\n");
#endif /* SLOWstrstr */
#ifndef NO_COMSAT
-#ifndef UDP_protocolno
- ;{ const struct protoent*p;
- if(p=getprotobyname(COMSATprotocol))
- { printf("#define UDP_protocolno %d\n",p->p_proto);
-#else
- ;{ if(1)
- {
-#endif
- ;{ const struct servent*serv;
- if(serv=getservbyname(COMSATservice,COMSATprotocol))
- printf("#define BIFF_serviceport \"%d\"\n",
- ntohs(serv->s_port));
- }
-#ifdef AF_INET
- ;{ const struct hostent*host;
- if(!strcmp("localhost",COMSAThost)&&
- (host=gethostbyname(COMSAThost))&&
- host->h_0addr_list&&host->h_addrtype==AF_INET&&
- host->h_length)
- { int j=host->h_length;
- const unsigned char*ad=(void*)host->h_0addr_list;
- printf("#define IP_localhost {");
- printf("%d",*ad++);
- while(--j)
- printf(",%d",*ad++);
- puts("}");
- }
- }
+#ifndef AF_INET
+ puts("#define NO_COMSAT");
#endif /* AF_INET */
- }
- else
- puts("#define NO_COMSAT");
- }
#endif /* NO_COMSAT */
;{ unsigned long s=(size_t)~0;int bits;
for(bits=1;s>>=1;bits++);
--- src/comsat.c
+++ src/comsat.c 2006-10-24 12:46:44.000000000 +0000
@@ -27,7 +27,8 @@ static /*const*/char rcsid[]=
#include "comsat.h"
static int csvalid; /* is it turned on with a good address? */
-static struct sockaddr_in csaddr;
+static struct addrinfo cai;
+static struct sockaddr *csaddr;
static char*cslastf,*cslgname;
void setlfcs(folder)const char*folder; /* set lastfolder for comsat */
@@ -62,56 +63,32 @@ void setlgcs(name)const char*name; /
}
int setcomsat(chp)const char*chp;
-{ char*chad;int newvalid; struct sockaddr_in newaddr;
+{ char*chad;int newvalid; struct addrinfo *res, hints;
chad=strchr(chp,SERV_ADDRsep); /* @ separator? */
if(!chad&&!renvint(-1L,chp))
return csvalid=0; /* turned off comsat */
newvalid=1;
if(chad)
*chad++='\0'; /* split the specifier */
+ if(!chad||!*chp) /* no service */
+ chp=BIFF_serviceport; /* new balls please! */
if(!chad||!*chad) /* no host */
-#ifndef IP_localhost /* Is "localhost" preresolved? */
chad=COMSAThost; /* nope, use default */
-#else /* IP_localhost */
- { static const unsigned char ip_localhost[]=IP_localhost;
- newaddr.sin_family=AF_INET;
- tmemmove(&newaddr.sin_addr,ip_localhost,sizeof ip_localhost);
- }
- else
-#endif /* IP_localhost */
- { const struct hostent*host; /* what host? paranoid checks */
- if(!(host=gethostbyname(chad))||!host->h_0addr_list)
- { bbzero(&newaddr.sin_addr,sizeof newaddr.sin_addr);
- newvalid=0; /* host can't be found, too bad */
- }
- else
- { newaddr.sin_family=host->h_addrtype; /* address number found */
- tmemmove(&newaddr.sin_addr,host->h_0addr_list,host->h_length);
- }
- endhostent();
- }
- if(newvalid) /* so far, so good */
- { int s;
- if(!chad||!*chp) /* no service */
- chp=BIFF_serviceport; /* new balls please! */
- s=strtol(chp,&chad,10);
- if(chp!=chad) /* the service is not numeric */
- newaddr.sin_port=htons((short)s); /* network order */
- else
- { const struct servent*serv;
- serv=getservbyname(chp,COMSATprotocol); /* so get its no. */
- if(serv)
- newaddr.sin_port=serv->s_port;
- else
- { newaddr.sin_port=htons((short)0); /* no such service */
- newvalid=0;
- }
- endservent();
- }
- }
+ bzero(&hints,sizeof(hints));
+ hints.ai_socktype=SOCK_DGRAM;
+ hints.ai_flags=AI_ADDRCONFIG;
+ if(getaddrinfo(chad,chp,&hints,&res))
+ newvalid=0;
+
onguard(); /* update the address atomically */
if(csvalid=newvalid)
- tmemmove(&csaddr,&newaddr,sizeof(newaddr));
+ { if(csaddr)
+ free(csaddr);
+ csaddr=malloc(res->ai_addrlen);
+ tmemmove(csaddr,res->ai_addr,res->ai_addrlen);
+ tmemmove(&cai,res,sizeof(cai));
+ freeaddrinfo(res);
+ }
offguard();
return newvalid;
}
@@ -132,8 +109,8 @@ void sendcomsat(folder)const char*folder
}
strlcat(buf,COMSATxtrsep,linebuf); /* custom seperator */
strlcat(buf,p,linebuf); /* where was it delivered? */
- if((s=socket(AF_INET,SOCK_DGRAM,UDP_protocolno))>=0)
- { sendto(s,buf,strlen(buf),0,(struct sockaddr*)&csaddr,sizeof(csaddr));
+ if((s=socket(cai.ai_family,cai.ai_socktype,cai.ai_protocol))>=0)
+ { sendto(s,buf,strlen(buf),0,csaddr,cai.ai_addrlen);
rclose(s);
yell("Notified comsat:",buf);
}
--- src/network.h
+++ src/network.h 2006-10-24 12:46:44.000000000 +0000
@@ -1,19 +1,13 @@
/*$Id$*/
-#include <sys/socket.h> /* socket() sendto() AF_INET
+#include <sys/socket.h> /* socket() sendto() */
/* SOCK_DGRAM */
-#include <netdb.h> /* gethostbyname() getservbyname()
- /* getprotobyname() */
-#include <netinet/in.h> /* htons() struct sockaddr_in */
+#include <netdb.h> /* getaddrinfo() */
#ifndef BIFF_serviceport
#define BIFF_serviceport COMSATservice
#endif
-#ifndef h_0addr_list
-#define h_0addr_list h_addr_list[0] /* POSIX struct member */
-#endif
-
#ifndef NO_const /* since network.h is outside the autoconf const check */
#ifdef const /* loop, we need this backcheck for some systems */
#undef const

View File

@ -0,0 +1,64 @@
---
man/mailstat.man | 40 ++++++++++++++++++++++++++++++++++++++++
src/exopen.h | 2 +-
2 files changed, 41 insertions(+), 1 deletion(-)
--- man/mailstat.man
+++ man/mailstat.man 2004-02-23 13:53:50.000000000 +0000
@@ -36,5 +36,45 @@ silent in case of no mail
Customise to your heart's content, this program is only provided as a
guideline.
.SH AUTHOR
+This manual page was written by Santiago Vila <sanvila@ctv.es>
+for the Debian GNU/Linux distribution (but may be used by others).
+.TH MAILSTAT 1
+.SH NAME
+mailstat \- shows mail-arrival statistics
+.SH SYNOPSIS
+.B mailstat
+[\-klmots] [logfile]
+.SH DESCRIPTION
+.B mailstat
+parses a procmail-generated $LOGFILE and displays
+a summary about the messages delivered to all folders
+(total size, average size, nr of messages).
+The $LOGFILE is truncated to zero length, unless the
+.B -k
+option is used.
+Exit code 0 if mail arrived, 1 if no mail arrived.
+.SH OPTIONS
+.TP
+.I \-k
+keep logfile intact
+.TP
+.I \-l
+long display format
+.TP
+.I \-m
+merge any errors into one line
+.TP
+.I \-o
+use the old logfile
+.TP
+.I \-t
+terse display format
+.TP
+.I \-s
+silent in case of no mail
+.SH NOTES
+Customise to your heart's content, this program is only provided as a
+guideline.
+.SH AUTHOR
This manual page was written by Santiago Vila <sanvila@debian.org>
for the Debian GNU/Linux distribution (but may be used by others).
--- src/exopen.h
+++ src/exopen.h 2004-02-23 13:54:04.000000000 +0000
@@ -7,7 +7,7 @@ int
rlink P((const char*const old,const char*const newn,struct stat*st)),
hlink P((const char*const old,const char*const newn));
-#define UNIQnamelen 30 /* require how much space as a first guess? */
+#define UNIQnamelen 64 /* require how much space as a first guess? */
#define MINnamelen 14 /* cut to this on ENAMETOOLONG */
#define doCHOWN 1

View File

@ -0,0 +1,36 @@
---
src/mailfold.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- src/mailfold.c
+++ src/mailfold.c 2006-01-13 17:15:39.000000000 +0000
@@ -120,13 +120,19 @@ jin: while(part&&(i=rwrite(s,source,BLKS
}
writefin:
i=type!=ft_PIPE&&fsync(s)&&errno!=EINVAL; /* EINVAL => wasn't a file */
+ if ((i&&!len?-1:len)&&lasttell>=0)
+ { int serrno=errno;
+ if(ftruncate(s,lasttell)) lasttell= -1;
+ SETerrno(serrno);
+ }
+ /* else: Do _not_ reset lasttell to -1 because the value is used for biff */
if(ft_lock(type))
{ int serrno=errno; /* save any error information */
if(fdunlock())
nlog("Kernel-unlock failed\n");
SETerrno(serrno);
}
- i=rclose(s)||i;
+ i=rclose(s)||i; /* if this fails, we should truncate, but it's too late */
} /* return an error even if nothing was to be sent */
return i&&!len?-1:len;
}
@@ -237,7 +243,7 @@ dumpf: { switch(errno)
#endif
default:writeerr(buf);
}
- if(lasttell>=0&&!truncate(boxname,lasttell)&&(logopened||verbose))
+ if(lasttell>=0&&(logopened||verbose))
nlog("Truncated file to former size\n"); /* undo garbage */
ret0: return 0;
}

87
procmail-3.22.dif Normal file
View File

@ -0,0 +1,87 @@
---
Makefile | 12 +++++++-----
config.h | 8 ++++----
2 files changed, 11 insertions(+), 9 deletions(-)
--- Makefile
+++ Makefile 2004-02-23 14:01:47.000000000 +0000
@@ -53,7 +53,7 @@ MAN5DIR = $(MANDIR)/man$(MAN5SUFFIX)
# Makefile.0 - mark, don't (re)move this, a sed script needs it
-LOCKINGTEST=__defaults__
+#LOCKINGTEST=__defaults__
#LOCKINGTEST=/tmp . # Uncomment and add any directories you see fit.
# If LOCKINGTEST is defined, autoconf will NOT
@@ -74,19 +74,20 @@ LOCKINGTEST=100 # Uncomment (and change)
# Or them together to get the desired combination.
# Optional system libraries we search for
-SEARCHLIBS = -lm -ldir -lx -lsocket -lnet -linet -lnsl_s -lnsl_i -lnsl -lsun \
- -lgen -lsockdns -ldl
+# SEARCHLIBS = -lm -ldir -lx -lsocket -lnet -linet -lnsl_s -lnsl_i -lnsl -lsun \
+# -lgen -lsockdns -ldl
+SEARCHLIBS = -lm
# -lresolv # not really needed, is it?
# Informal list of directories where we look for the libraries in SEARCHLIBS
LIBPATHS=/lib64 /usr/lib64 /lib /usr/lib
-GCC_WARNINGS = -O2 -pedantic -Wreturn-type -Wunused -Wformat -Wtraditional \
+GCC_WARNINGS = -pedantic -Wreturn-type -Wunused -Wformat -Wtraditional \
-Wpointer-arith -Wconversion -Waggregate-return \
#-Wimplicit -Wshadow -Wid-clash-6 #-Wuninitialized
# The place to put your favourite extra cc flag
-CFLAGS0 = -O #$(GCC_WARNINGS)
+CFLAGS0 = $(RPM_OPT_FLAGS) -D_GNU_SOURCE -pipe #$(GCC_WARNINGS)
LDFLAGS0= -s
# Read my libs :-)
LIBS=
@@ -95,6 +96,7 @@ CFLAGS1 = $(CFLAGS0) #-posix -Xp
LDFLAGS1= $(LDFLAGS0) $(LIBS) #-lcposix
####CC = cc # gcc
+CC = gcc
# object file extension
O = o
RM = /bin/rm -f
--- config.h
+++ config.h 2011-11-14 13:45:23.579146109 +0000
@@ -34,7 +34,7 @@
* DEFSPATH and DEFPATH defines below
*/
#define DEFSPATH "PATH=/usr/local/bin:/usr/bin:/bin" /* */
-#define DEFPATH "PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin" /* */
+#define DEFPATH "PATH=$HOME/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin" /* */
/* every environment variable appearing in PRESTENV will be set or wiped
* out of the environment (variables without an '=' sign will be thrown
@@ -52,7 +52,7 @@
is group writable or contained in a group writable home directory
if the group involved is the user's default group. */
-/*#define LMTP /* uncomment this if you
+#define LMTP /* uncomment this if you
want to use procmail
as an LMTP (rfc2033) server, presumably for invocation by an MTA.
The file examples/local_procmail_lmtp.m4 contains info on how to
@@ -79,7 +79,7 @@
/*#define NO_fcntl_LOCK /* uncomment any of these three if you */
/*#define NO_lockf_LOCK /* definitely do not want procmail to make */
-/*#define NO_flock_LOCK /* use of those kernel-locking methods */
+#define NO_flock_LOCK /* use of those kernel-locking methods */
/* If you set LOCKINGTEST to a binary number
than there's no need to set these. These #defines are only useful
if you want to disable particular locking styles but are unsure which
@@ -91,7 +91,7 @@
restriction does not apply to the /etc/procmailrc and
/etc/procmailrcs files) */
-/*#define NO_NFS_ATIME_HACK /* uncomment if you're definitely not using
+#define NO_NFS_ATIME_HACK /* uncomment if you're definitely not using
NFS mounted filesystems and can't afford
procmail to sleep for 1 sec. before writing to an empty regular
mailbox. This lets programs correctly judge whether there is unread

BIN
procmail-3.24-patches.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
procmail-3.24.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

24
procmail-cflags.dif Normal file
View File

@ -0,0 +1,24 @@
---
Makefile | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
--- Makefile
+++ Makefile 2011-11-14 13:39:35.711147708 +0000
@@ -82,13 +82,12 @@ SEARCHLIBS = -lm
# Informal list of directories where we look for the libraries in SEARCHLIBS
LIBPATHS=/lib64 /usr/lib64 /lib /usr/lib
-GCC_WARNINGS = -pedantic -Wreturn-type -Wunused -Wformat -Wtraditional \
- -Wpointer-arith -Wconversion -Waggregate-return \
- #-Wimplicit -Wshadow -Wid-clash-6 #-Wuninitialized
+GCC_WARNINGS = -pedantic -Wall -Wformat -Wpointer-arith
+XCFLAGS=
# The place to put your favourite extra cc flag
-CFLAGS0 = $(RPM_OPT_FLAGS) -D_GNU_SOURCE -pipe #$(GCC_WARNINGS)
-LDFLAGS0= -s
+CFLAGS0 = $(RPM_OPT_FLAGS) -D_GNU_SOURCE -pipe $(XCFLAGS) #$(GCC_WARNINGS)
+LDFLAGS0=
# Read my libs :-)
LIBS=

View File

@ -0,0 +1,24 @@
diff --git a/initmake b/initmake
index 82d718d..43690fe 100755
--- a/initmake
+++ b/initmake
@@ -124,7 +124,7 @@ else
fi
cat >_autotst.c <<HERE
-main()
+int main()
{ return 0;
}
HERE
@@ -200,8 +200,8 @@ cat >_autotst.c <<HERE
#include <sys/types.h>
#include <stdio.h>
#include <sys/stat.h>
-main()
-{ struct stat buf;return!&buf;
+int main()
+{ struct stat buf;return!&buf; return 0;
}
HERE

361
procmail.changes Normal file
View File

@ -0,0 +1,361 @@
-------------------------------------------------------------------
Wed Aug 9 09:09:55 UTC 2023 - Dr. Werner Fink <werner@suse.de>
- Update to procmail 3.24 (New Upstream)
- Don't coredump in comsat code if interrupted early
- Correctly handle COMSAT=on
- Once used, the 'H' and 'r' flags would never be cleared
- Fix possible buffer overflow in variable-capture actions
- Fix up the parsing of variable-capture actions
- LMTP code assumed sizeof(long)==sizeof(int)
- SHELL is now always preset to /bin/sh. USER_SHELL contains
the shell from the user's passwd entry
- When HOST is mismatched, reset it for the next rcfile
- Always read in a new, global rcfile (/etc/procmail.conf)
to allow runtime configuration of variables like DEFAULT.
This rcfile cannot deliver or filter messages
- Mismatched HOST in /etc/procmailrc didn't discard the message
- backquote expansion in a condition disabled header
concatenation for that condition
- LMTP didn't correctly handle quoted localparts
- Removed SIZE extension from LMTP (unsupportable semantics)
- Don't coredump if unable to exec /bin/sh
- Enable "+detail" processing in LMTP mode by passing the
delimiter (e.g., "+") as an optional argument after -z
- In LMTP mode, save the domain of the recipient in
PROCMAIL_DOMAIN
- Set PROCMAIL_MODE to one of "d", "m", "z", or "" to reflect
the mode option it was invoked with, if any
- Fixed all bugs collected by Debian and others
during the past 21 years. See the git commit history
for detailed descriptions.
- Port patches
* procmail-3.22-autoconf.dif
* procmail-3.22-headerconcat.dif
* procmail-3.22-ipv6.patch
* procmail-3.22-mailstat.patch
* procmail-3.22-owl-truncate.dif
* procmail-3.22.dif
* procmail-cflags.dif
- Remove former Debian and SUSE patches from procmail-3.22-patches.tar.bz2
* 04
* 06
* 10
* 11
* 12
* 13
* 14
* 15
* 16
* 17
* 18
* 19
* 22
* 23
* 24
* 25
* 26
* 27
* 28
* 29
* 30
- Collect and port our patches from old procmail-3.22-patches.tar.bz2
into new procmail-3.24-patches.tar.bz2
* 01
* 02
* 03
* 05
* 07
* 08
* 09
* 20
* 21
-------------------------------------------------------------------
Sun May 2 17:30:16 UTC 2021 - Dirk Müller <dmueller@suse.com>
- modernize spec file (move license to licensedir)
-------------------------------------------------------------------
Thu Nov 26 03:15:35 UTC 2020 - Bernhard Wiedemann <bwiedemann@suse.com>
- Add reproducible2.patch to negate influences from preinstallimage
to make package build reproducible
-------------------------------------------------------------------
Fri Oct 23 06:58:01 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Do not use lto compiler flags at all with this kind of code
-------------------------------------------------------------------
Fri Nov 8 11:05:25 UTC 2019 - Dr. Werner Fink <werner@suse.de>
- Add latest patch sets from Debian:
* patch set 27 replaces procmail-3.22-CVE-2014-3618.patch
* patch set 28 does fix off-by-one error that makes procmail to
segfault on certain .procmailrc files
* patch set 29 does fix formail memory corruption
* patch set 30 replaces procmail-formisc.c.patch for CVE-2017-16844
- Remove obsolate patches
* procmail-3.22-CVE-2014-3618.patch
* procmail-formisc.c.patch
-------------------------------------------------------------------
Fri Jul 12 11:40:29 UTC 2019 - Martin Liška <mliska@suse.cz>
- Add procmail-fix-Werror=return-type.patch in order to fix
-Werror=return-type errors.
-------------------------------------------------------------------
Fri Nov 17 10:37:58 UTC 2017 - werner@suse.de
- Add patch procmail-formisc.c.patch to fix bug bsc#1068648
CVE-2017-16844
-------------------------------------------------------------------
Mon May 29 18:59:25 UTC 2017 - bwiedemann@suse.com
- Add reproducible.patch to have binaries independent of speed
of compile system (boo#1041534)
-------------------------------------------------------------------
Mon Dec 29 14:39:04 UTC 2014 - meissner@suse.com
- build with PIE
-------------------------------------------------------------------
Mon Dec 22 09:24:14 UTC 2014 - dimstar@opensuse.org
- Drop .keyring and .sig files: procmail is signed using an MD5
type key, which is no longer accepted by GPG 2.1
- Drop the usage of gpg-offline: we don't have keys to verify and
the source validator performs the action transparent nowadays.
-------------------------------------------------------------------
Thu Sep 4 13:32:42 UTC 2014 - werner@suse.de
- Correct licenses
- Add cflags() shell function to be able to check for compiler,
linker, and assembler flags, that is if those are supported by
the compiler, linker, or assembler.
-------------------------------------------------------------------
Thu Sep 4 08:39:12 UTC 2014 - werner@suse.de
- Add patch procmail-3.22-CVE-2014-3618.patch to fix heap-overflow
in procmail's formail utility when processing specially-crafted
email headers (bnc#894999, CVE-2014-3618)
-------------------------------------------------------------------
Mon Apr 15 09:04:23 UTC 2013 - idonmez@suse.com
- Cleanup spec file
- Add Source URL, see https://en.opensuse.org/SourceUrls
- Add GPG verification
-------------------------------------------------------------------
Thu Feb 28 06:03:41 UTC 2013 - coolo@suse.com
- update license to new format
-------------------------------------------------------------------
Mon Nov 14 14:14:34 UTC 2011 - werner@suse.de
- Go forward and add the patches from Debian
- Also add ipv6 patch from openmamba
- Adop or drop our own patches
- Do not sleep a second on NFS based home shares
- Support LMTP (rfc2033: Local Mail Transfer Protocol) server
-------------------------------------------------------------------
Tue Feb 8 23:24:29 UTC 2011 - seife+obs@b1-systems.com
- the only thing that needs mimencode are the examples
change the "Requires: mimencode" to "Recommends"
-------------------------------------------------------------------
Tue Dec 15 11:54:17 CET 2009 - jengelh@medozas.de
- enable parallel building
-------------------------------------------------------------------
Fri Nov 20 16:08:01 CET 2009 - werner@suse.de
- Fix that last fix (bnc#556509)
-------------------------------------------------------------------
Fri Jan 30 13:23:46 CET 2009 - od@suse.de
- assume RFC2822-compliant header continuation lines, do not cover
up for older mail clients that insert more spacing (bnc#469222)
-------------------------------------------------------------------
Tue Nov 11 11:23:28 CET 2008 - kukuk@suse.de
- vacation is no required package
-------------------------------------------------------------------
Tue Mar 4 13:48:05 CET 2008 - werner@suse.de
- Avoid warnings due oldish C code of procmail
- Be sure that autoconf catchs missing pw_class
-------------------------------------------------------------------
Thu Jun 28 14:51:06 CEST 2007 - werner@suse.de
- Be sure that standard programs are available in procmailrc
-------------------------------------------------------------------
Mon Jan 8 13:33:24 CET 2007 - werner@suse.de
- Use only fcntl(2) for locking, do not mix with flock(2) (#231845)
-------------------------------------------------------------------
Fri May 26 19:19:08 CEST 2006 - schwab@suse.de
- Don't strip binaries.
-------------------------------------------------------------------
Thu May 11 14:26:18 CEST 2006 - werner@suse.de
- Enable large file support (bug #174497)
-------------------------------------------------------------------
Wed Jan 25 21:30:51 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Fri Jan 13 18:26:40 CET 2006 - werner@suse.de
- Fix the last bug fix to re-enable biff/comsat (bug #135883)
-------------------------------------------------------------------
Mon Nov 7 12:18:54 CET 2005 - werner@suse.de
- Do not truncate a folder if reached quota (bug #132530)
-------------------------------------------------------------------
Sun May 9 23:24:16 CEST 2004 - od@suse.de
- fixed handling of folded headers: delete leading whitespace
-------------------------------------------------------------------
Fri Mar 26 01:22:54 CET 2004 - ro@suse.de
- added postfix to neededforbuild
-------------------------------------------------------------------
Mon Feb 23 16:38:07 CET 2004 - werner@suse.de
- Reenabled locking with fcntl.
-------------------------------------------------------------------
Mon Feb 23 13:56:51 CET 2004 - werner@suse.de
- Update to procmail 3.22 (includes maildir feature)
-------------------------------------------------------------------
Sun Jan 11 09:57:46 CET 2004 - adrian@suse.de
- build as user
-------------------------------------------------------------------
Mon Sep 1 11:46:14 CEST 2003 - pthomas@suse.de
- Pass -fno-strict-aliasing to gcc, as regexp.c uses type punning
and thus could be miscompiled.
-------------------------------------------------------------------
Wed May 28 15:04:03 CEST 2003 - coolo@suse.de
- use BuildRoot
-------------------------------------------------------------------
Tue May 13 16:42:23 CEST 2003 - mmj@suse.de
- Use %defattr
-------------------------------------------------------------------
Wed Jan 22 21:09:57 CET 2003 - mmj@suse.de
- Enabled locking with fcntl as well
-------------------------------------------------------------------
Tue Sep 17 17:34:28 CEST 2002 - ro@suse.de
- removed bogus self-provides
-------------------------------------------------------------------
Thu Jan 11 13:13:32 CET 2001 - werner@suse.de
- Update to 3.15.1 due security:
* A race to create the mailspool would bounce one of the
messages due to an internal error
* LC_ in KEEPENV would preserve only the first LC_foo variable
* Strip runtime linker variables (LD_*) from environment on
all platforms
* Drop duplicate and malformed environment entries
-------------------------------------------------------------------
Tue Jan 9 17:50:08 CET 2001 - werner@suse.de
- Update to 3.15 due to security issue
-------------------------------------------------------------------
Thu Nov 23 18:50:12 CET 2000 - werner@suse.de
- Update to 3.14
-------------------------------------------------------------------
Wed Jun 7 10:13:40 CEST 2000 - ro@suse.de
- doc relocation
-------------------------------------------------------------------
Sun Feb 27 15:57:03 CET 2000 - kukuk@suse.de
- Move /usr/man -> /usr/share/man
-------------------------------------------------------------------
Mon Dec 6 13:48:43 CET 1999 - werner@suse.de
- Fix default PATH
-------------------------------------------------------------------
Fri Oct 1 21:37:05 MEST 1999 - werner@suse.de
- New version 3.13.1
- Add procmail-maildir.patch (supporting of maildirs with ending '/')
- Add procmail-locking.patch (no locking for directories required)
-------------------------------------------------------------------
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
----------------------------------------------------------------------------
Fri Jul 17 14:36:50 MEST 1998 - werner@suse.de
- Use mktemp
----------------------------------------------------------------------------
Thu Jul 16 22:30:18 MET DST 1998 - werner@suse.de
- fix for mailstat script
----------------------------------------------------------------------------
Mon Jul 7 13:17:08 CEST 1997 - florian@suse.de
- update to version 3.11-pre7
- add docu files in /usr/doc/packages
----------------------------------------------------------------------------
Tue Oct 22 22:14:08 MEST 1996 - florian@suse.de
- Umstieg auf non-sgid-mail spool-Verzeichnis.

138
procmail.spec Normal file
View File

@ -0,0 +1,138 @@
#
# spec file for package procmail
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: procmail
Version: 3.24
Release: 0
Summary: A program for local e-mail delivery
License: Artistic-1.0 OR GPL-2.0-or-later
Group: Productivity/Networking/Email/Clients
URL: https://github.com/BuGlessRB/procmail/
Source0: https://github.com/BuGlessRB/procmail/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: procmail-%{version}-patches.tar.bz2
Patch0: procmail-3.22-mailstat.patch
Patch1: procmail-3.22.dif
Patch2: procmail-cflags.dif
Patch3: procmail-3.22-headerconcat.dif
Patch4: procmail-3.22-owl-truncate.dif
Patch5: procmail-3.22-autoconf.dif
Patch6: procmail-3.22-ipv6.patch
# PATCH-FIX-SUSE bmwiedemann -- make build reproducible
Patch8: reproducible.patch
Patch10: procmail-fix-Werror=return-type.patch
Patch11: reproducible2.patch
BuildRequires: pcre-devel
BuildRequires: postfix
Requires: /bin/sed
Recommends: %{_bindir}/mimencode
%description
Sendmail calls procmail to deliver email into a local folder. Procmail
can be configured to store e-mail in different folders.
%prep
%setup -q -b1
for p in ../procmail-%{version}-patches/* ; do
test -e $p || break
echo Patch $p
patch -s -p1 --fuzz=0 < $p
done
%patch0
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6
%patch8 -p1
%patch10 -p1
%patch11 -p1
sed -ri '\@^/\*@,\@\*/@{ s@^(/\*[^*]*)(/\*)@\1\*/ \2@; }' config.h
sed -ri '\@^/\*@,\@\*/@{ s@^(/\*[^*]*)(/\*)@\1\*/ \2@; }' src/includes.h
sed -ri '\@^#.*[[:blank:]]+/\*[^/]*$@M,\@\*/$@{ s@(^[[:blank:]]+)/\*@\1 @;}' src/includes.h
%build
%define _lto_cflags %{nil}
cflags ()
{
local flag=$1; shift
local var=$1; shift
local gold
test -n "${flag}" -a -n "${var}" || return
case "${!var}" in
*${flag}*) return
esac
if type ld.gold > /dev/null 2>&1 ; then
gold=-Wl,-fuse-ld=gold
fi
case "$flag" in
-Wl,*)
set -o noclobber
if echo 'int main () { return 0; }' | \
${CC:-gcc} %{optflags} -Werror $gold $flag -o /dev/null -xc - > /dev/null 2>&1 ; then
eval $var=\${$var:+\$$var\ }$flag
fi
set +o noclobber
rm -f ldtest.c
;;
*)
if ${CC:-gcc} -Werror $gold $flag -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then
eval $var=\${$var:+\$$var\ }$flag
fi
if ${CXX:-g++} -Werror $gold $flag -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1 ; then
eval $var=\${$var:+\$$var\ }$flag
fi
esac
}
RPM_OPT_FLAGS="%{optflags}"
XCFLAGS="$(getconf LFS_CFLAGS)"
cflags -fPIE RPM_OPT_FLAGS
cflags -std=c89 RPM_OPT_FLAGS
cflags -Wno-parentheses RPM_OPT_FLAGS
cflags -Wno-sign-compare RPM_OPT_FLAGS
cflags -Wno-unprototyped-calls RPM_OPT_FLAGS
cflags -pipe RPM_OPT_FLAGS
cflags -fno-strict-aliasing XCFLAGS
cflags -Wl,-O2 LDFLAGS0
cflags -Wl,--hash-size=8599 LDFLAGS0
cflags -pie LDFLAGS0
export RPM_OPT_FLAGS XCFLAGS LDFLAGS0
%make_build XCFLAGS="${XCFLAGS}" MANDIR=%{_mandir} LDFLAGS0="${LDFLAGS0}"
%install
mkdir -p %{buildroot}%{_mandir}/man{1,5} %{buildroot}%{_bindir}
make MANDIR=%{buildroot}%{_mandir} BINDIR=%{buildroot}%{_bindir} install
install -m 644 man/mailstat.man %{buildroot}%{_mandir}/man1/mailstat.1
%files
%license COPYING
%doc Artistic
%doc FAQ FEATURES README examples
%{_bindir}/formail
%{_bindir}/lockfile
%{_bindir}/mailstat
%{_bindir}/procmail
%{_mandir}/man1/formail.1%{?ext_man}
%{_mandir}/man1/lockfile.1%{?ext_man}
%{_mandir}/man1/procmail.1%{?ext_man}
%{_mandir}/man1/mailstat.1%{?ext_man}
%{_mandir}/man5/procmailex.5%{?ext_man}
%{_mandir}/man5/procmailrc.5%{?ext_man}
%{_mandir}/man5/procmailsc.5%{?ext_man}
%changelog

17
reproducible.patch Normal file
View File

@ -0,0 +1,17 @@
Index: procmail-3.22/src/autoconf
===================================================================
---
src/autoconf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/autoconf
+++ b/src/autoconf 2023-08-09 08:57:47.506347981 +0000
@@ -1251,7 +1251,7 @@ int main(argc,argv)int argc;const char*a
/* Your system's strstr() is %.2f times %sER than my C-routine */\n",
syscnt>=iter?(double)syscnt/iter:(double)iter/syscnt,
syscnt>=iter?"SLOW":"FAST");
- if(syscnt>iter+iter/16) /* if at least 1.0625 times slower */
+ if(0) /* always use system strstr to have reproducible binaries */
printf("\
#define SLOWstrstr\t\t\t /* using my substitute instead */\n");
}

23
reproducible2.patch Normal file
View File

@ -0,0 +1,23 @@
Author: Bernhard M. Wiedemann <bwiedemann suse de>
Date: 2020-11-26
always set setrgid_RUNTIME_CHECK
without this patch, builds with preinstallimage did not have this flag
but builds without preinstallimage did have setrgid_RUNTIME_CHECK defined
causing problems for verification of binaries
diff --git a/src/autoconf b/src/autoconf
index b0fef8a..f2f8351 100755
--- a/src/autoconf
+++ b/src/autoconf
@@ -1302,8 +1302,7 @@ int main(argc,argv)int argc;const char*argv[];
if(!setrgid(groups[i])&&getgid()!=groups[i])
puts("#define setrgid_BRAIN_DAMAGE");
}
- else
- puts("#define setrgid_RUNTIME_CHECK");
+ puts("#define setrgid_RUNTIME_CHECK");
}
#endif
skipsetrgid:;