summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/Makefile51
-rw-r--r--debian/patches/align.893.p117
-rw-r--r--debian/patches/cf.mailer.cyrus.m418
-rw-r--r--debian/patches/mime-patch62
-rw-r--r--debian/patches/mime-patch.README31
-rw-r--r--debian/patches/mrbl.p3168
-rw-r--r--debian/patches/mrbl.p3.README12
-rw-r--r--debian/patches/patch.DOS21
-rw-r--r--debian/patches/patch.IP_SRCROUTE94
-rw-r--r--debian/patches/patch.dont_masquerade_local39
-rw-r--r--debian/patches/patch.ldap.m417
-rw-r--r--debian/patches/patch.ldap.src377
-rw-r--r--debian/patches/patch.local_procmail68
-rw-r--r--debian/patches/patch.mail.local68
-rw-r--r--debian/patches/patch.rmail52
-rw-r--r--debian/patches/prescan.8.9.3.patch122
-rw-r--r--debian/patches/proto.m4.8.9.313
-rw-r--r--debian/patches/sendmail.8.9.3.security.cr.patch487
-rw-r--r--debian/patches/src.conf.h.linux54
-rw-r--r--debian/patches/util.c.893.patch48
20 files changed, 1819 insertions, 0 deletions
diff --git a/debian/patches/Makefile b/debian/patches/Makefile
new file mode 100644
index 0000000..847f7a9
--- /dev/null
+++ b/debian/patches/Makefile
@@ -0,0 +1,51 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+#
+# This file is also based upon prior sendmail makefiles
+#
+# Richard Nelson <cowboy@debian.org>
+
+
+#-------------
+create:
+ diff -cr ../../cf/m4/proto.m4 proto.m4 > patch.ldap.m4 || /bin/true
+ #diff -cr ../../cf/mailer/local.m4 local.m4 > patch.dont_masquerade_local || /bin/true
+ #diff -cr ../../cf/feature/local_procmail.m4 local_procmail.m4 > patch.local_procmail || /bin/true
+ #diff -cr ../../src/conf.h conf.h > patch.IP_SRCROUTE || /bin/true
+ #diff -cr ../../src/daemon.c daemon.c >> patch.IP_SRCROUTE || /bin/true
+
+patch:
+ patch -p1 --version-control=never -l < debian/patches/mime-patch
+ patch -p5 --version-control=never < debian/patches/mrbl.p3
+ patch -p3 --version-control=never < debian/patches/patch.local_procmail
+ patch -p2 --version-control=never < debian/patches/patch.IP_SRCROUTE
+ patch -p2 --version-control=never < debian/patches/patch.dont_masquerade_local
+ patch -p2 --version-control=never < debian/patches/patch.ldap.m4
+ cd src && patch -p0 --version-control=never < ../debian/patches/patch.ldap.src
+ cd rmail && patch -p0 --version-control=never < ../debian/patches/patch.rmail
+ cd src && patch -p0 --version-control=never < ../debian/patches/patch.DOS
+ patch -p0 --version-control=never -l < debian/patches/cf.mailer.cyrus.m4
+ patch -p0 --version-control=never -l < debian/patches/patch.mail.local
+ patch -p0 --version-control=never -l < debian/patches/sendmail.8.9.3.security.cr.patch
+ patch -p1 --version-control=never -l < debian/patches/prescan.8.9.3.patch
+
+
+unpatch:
+ patch -R -p1 --version-control=never -l < debian/patches/mime-patch
+ patch -R -p5 --version-control=never < debian/patches/mrbl.p3
+ patch -R -p3 --version-control=never < debian/patches/patch.local_procmail
+ patch -R -p2 --version-control=never < debian/patches/patch.IP_SRCROUTE
+ patch -R -p2 --version-control=never < debian/patches/patch.dont_masquerade_local
+ patch -R -p2 --version-control=never < debian/patches/patch.ldap.m4
+ cd src && patch -R -p0 --version-control=never < ../debian/patches/patch.ldap.src
+ cd rmail && patch -R -p0 --version-control=never < ../debian/patches/patch.rmail
+ cd src && patch -R -p0 --version-control=never < ../debian/patches/patch.DOS
+ patch -R -p0 --version-control=never -l < debian/patches/cf.mailer.cyrus.m4
+ patch -R -p0 --version-control=never -l < debian/patches/patch.mail.local
+ patch -R -p0 --version-control=never -l < debian/patches/sendmail.8.9.3.security.cr.patch
+ patch -R -p1 --version-control=never -l < debian/patches/prescan.8.9.3.patch
+
+#-------------
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/patches/align.893.p1 b/debian/patches/align.893.p1
new file mode 100644
index 0000000..ff6add3
--- /dev/null
+++ b/debian/patches/align.893.p1
@@ -0,0 +1,17 @@
+--- ./src/main.c.ORIG Sun Jan 10 00:31:13 1999
++++ sendmail-8.9.3/src/main.c Sat Oct 30 04:29:25 1999
+@@ -528,10 +528,12 @@
+ {
+ for (i = 0; hp->h_addr_list[i] != NULL; i++)
+ {
++ struct in_addr ia;
+ char ipbuf[103];
+
++ bcopy(hp->h_addr_list[i], &ia, INADDRSZ);
+ snprintf(ipbuf, sizeof ipbuf, "[%.100s]",
+- inet_ntoa(*((struct in_addr *) hp->h_addr_list[i])));
++ inet_ntoa(ia));
+ if (tTd(0, 4))
+ printf("\ta.k.a.: %s\n", ipbuf);
+ setclass('w', ipbuf);
+
diff --git a/debian/patches/cf.mailer.cyrus.m4 b/debian/patches/cf.mailer.cyrus.m4
new file mode 100644
index 0000000..85f7632
--- /dev/null
+++ b/debian/patches/cf.mailer.cyrus.m4
@@ -0,0 +1,18 @@
+--- ./cf/mailer/cyrus.m4 Tue May 2 14:40:24 2000
++++ ./debian/patches/cf/mailer/cyrus.m4 Tue May 2 14:41:21 2000
+@@ -35,11 +35,11 @@
+ #
+
+ ifdef(`CYRUS_MAILER_FLAGS',, `define(`CYRUS_MAILER_FLAGS', `A5@/:|')')
+-ifdef(`CYRUS_MAILER_PATH',, `define(`CYRUS_MAILER_PATH', /usr/cyrus/bin/deliver)')
+-ifdef(`CYRUS_MAILER_ARGS',, `define(`CYRUS_MAILER_ARGS', `deliver -e -m $h -- $u')')
++ifdef(`CYRUS_MAILER_PATH',, `define(`CYRUS_MAILER_PATH', /usr/sbin/cyrdeliver)')
++ifdef(`CYRUS_MAILER_ARGS',, `define(`CYRUS_MAILER_ARGS', `cyrdeliver -e -m $h -- $u')')
+ ifdef(`CYRUS_MAILER_USER',, `define(`CYRUS_MAILER_USER', `cyrus:mail')')
+ ifdef(`CYRUS_BB_MAILER_FLAGS',, `define(`CYRUS_BB_MAILER_FLAGS', `')')
+-ifdef(`CYRUS_BB_MAILER_ARGS',, `define(`CYRUS_BB_MAILER_ARGS', `deliver -e -m $u')')
++ifdef(`CYRUS_BB_MAILER_ARGS',, `define(`CYRUS_BB_MAILER_ARGS', `cyrdeliver -e -m $u')')
+
+ POPDIVERT
+
+
diff --git a/debian/patches/mime-patch b/debian/patches/mime-patch
new file mode 100644
index 0000000..cf939b2
--- /dev/null
+++ b/debian/patches/mime-patch
@@ -0,0 +1,62 @@
+*** sendmail-8.9.3/src/mime.c.ORIG Tue Jan 19 01:35:11 1999
+--- sendmail-8.9.3/src/mime.c Sat Mar 13 01:39:15 1999
+***************
+*** 443,449 ****
+ {
+ /* no encoding necessary */
+ if (cte != NULL &&
+! bitset(MCIF_INMIME, mci->mci_flags) &&
+ !bitset(M87F_NO8TO7, flags))
+ {
+ /*
+--- 443,450 ----
+ {
+ /* no encoding necessary */
+ if (cte != NULL &&
+! bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME,
+! mci->mci_flags) &&
+ !bitset(M87F_NO8TO7, flags))
+ {
+ /*
+*** sendmail-8.9.3/src/headers.c.ORIG Tue Jan 26 15:54:50 1999
+--- sendmail-8.9.3/src/headers.c Tue Mar 16 20:43:31 1999
+***************
+*** 1369,1375 ****
+
+ /*
+ ** If we are converting this to a MIME message, add the
+! ** MIME headers.
+ */
+
+ #if MIME8TO7
+--- 1369,1375 ----
+
+ /*
+ ** If we are converting this to a MIME message, add the
+! ** MIME headers (but not in MIME mode!).
+ */
+
+ #if MIME8TO7
+***************
+*** 1377,1386 ****
+ bitset(EF_HAS8BIT, e->e_flags) &&
+ !bitset(EF_DONT_MIME, e->e_flags) &&
+ !bitnset(M_8BITS, mci->mci_mailer->m_flags) &&
+! !bitset(MCIF_CVT8TO7|MCIF_CVT7TO8, mci->mci_flags))
+ {
+! if (hvalue("MIME-Version", e->e_header) == NULL)
+! putline("MIME-Version: 1.0", mci);
+ if (hvalue("Content-Type", e->e_header) == NULL)
+ {
+ snprintf(obuf, sizeof obuf,
+--- 1377,1386 ----
+ bitset(EF_HAS8BIT, e->e_flags) &&
+ !bitset(EF_DONT_MIME, e->e_flags) &&
+ !bitnset(M_8BITS, mci->mci_mailer->m_flags) &&
+! !bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME, mci->mci_flags) &&
+! hvalue("MIME-Version", e->e_header) == NULL)
+ {
+! putline("MIME-Version: 1.0", mci);
+ if (hvalue("Content-Type", e->e_header) == NULL)
+ {
+ snprintf(obuf, sizeof obuf,
diff --git a/debian/patches/mime-patch.README b/debian/patches/mime-patch.README
new file mode 100644
index 0000000..e73635b
--- /dev/null
+++ b/debian/patches/mime-patch.README
@@ -0,0 +1,31 @@
+From: per@erix.ericsson.se (Per Hedeland)
+Newsgroups: news.software.nntp,comp.mail.sendmail
+Subject: Re: Duplicate "Content-Transfer-Encoding" header
+Date: 13 Apr 1999 01:21:51 GMT
+Organization: Ericsson Utvecklings AB, Stockholm, Sweden
+Lines: 61
+Message-ID: <7eu67f$p6b$1@news.du.etx.ericsson.se>
+References: <7et2k9$rk8$1@niobium.hgmp.mrc.ac.uk>
+NNTP-Posting-Host: super.du.etx.ericsson.se
+NNTP-Posting-User: per
+X-Newsreader: trn 4.0-test69 (20 September 1998)
+Xref: news.cistron.nl news.software.nntp:47781 comp.mail.sendmail:68808
+
+In article <7et2k9$rk8$1@niobium.hgmp.mrc.ac.uk> ggibbs@hgmp.mrc.ac.uk
+(Geoff Gibbs) writes:
+>I have a mail/news gateway running, using the mailpost/news2mail
+>software which comes with INN 2.2.
+>It is being fed from sendmail 8.9.1a
+>
+>I am seeing the error message :-
+>
+>post failed Duplicate "Content-Transfer-Encoding" header
+
+Upgrade to sendmail 8.9.3 + the patch below. Of course the duplicate
+header may have been introduced *before* the message arrived at *your*
+sendmail, in which case this won't help - but at least your sendmail
+won't be the cause.
+
+--Per Hedeland
+per@erix.ericsson.se
+
diff --git a/debian/patches/mrbl.p3 b/debian/patches/mrbl.p3
new file mode 100644
index 0000000..f73d239
--- /dev/null
+++ b/debian/patches/mrbl.p3
@@ -0,0 +1,168 @@
+diff -cr ./feature/rbl.m4 /home/ca/smi/sendmail/cf/feature/rbl.m4
+*** ./feature/rbl.m4 Tue Dec 29 09:42:13 1998
+--- /home/ca/smi/sendmail/cf/feature/rbl.m4 Sat Feb 20 13:58:31 1999
+***************
+*** 1,6 ****
+ divert(-1)
+ #
+! # Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ #
+ # By using this file, you agree to the terms and conditions set
+ # forth in the LICENSE file which can be found at the top level of
+--- 1,7 ----
+ divert(-1)
+ #
+! # Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
+! # All rights reserved.
+ #
+ # By using this file, you agree to the terms and conditions set
+ # forth in the LICENSE file which can be found at the top level of
+***************
+*** 9,15 ****
+ #
+
+ divert(0)
+! VERSIONID(`@(#)rbl.m4 8.8 (Berkeley) 5/19/1998')
+ divert(-1)
+!
+! define(`_RBL_', ifelse(_ARG_, `', `rbl.maps.vix.com', `_ARG_'))dnl
+--- 10,24 ----
+ #
+
+ divert(0)
+! ifdef(`_RBL_R_',`dnl',`dnl
+! VERSIONID(`$Id: rbl.m4,v 8.12 1999/02/20 21:58:31 ca Exp $')')
+ divert(-1)
+! define(`_RBL_SRV_',ifelse(_ARG_,`',`rbl.maps.vix.com',_ARG_))dnl
+! define(`_RBL_MSG_',ifelse(_ARG2_,`',`"Mail from " $`'&{client_addr} " refused by blackhole site '_RBL_SRV_`"',_ARG2_))dnl
+! define(`_RBL_R_',defn(`_RBL_R_')
+! `
+! # DNS based IP address spam list '_RBL_SRV_`
+! R$`'* $`': $`'&{client_addr}
+! R$`'-.$`'-.$`'-.$`'- $`': <?> $`'(host $`'4.$`'3.$`'2.$`'1.'_RBL_SRV_`. $`': OK $`')
+! R<?>OK $`': OKSOFAR
+! R<?>$`'+ $`'#error $`'@ 5.7.1 $`': '_RBL_MSG_)
+diff -cr ./m4/cfhead.m4 /home/ca/smi/sendmail/cf/m4/cfhead.m4
+*** ./m4/cfhead.m4 Tue Dec 29 09:42:08 1998
+--- /home/ca/smi/sendmail/cf/m4/cfhead.m4 Sat Feb 20 13:58:32 1999
+***************
+*** 1,5 ****
+ #
+! # Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
+ # Copyright (c) 1988, 1993
+ # The Regents of the University of California. All rights reserved.
+--- 1,6 ----
+ #
+! # Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
+! # All rights reserved.
+ # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
+ # Copyright (c) 1988, 1993
+ # The Regents of the University of California. All rights reserved.
+***************
+*** 40,51 ****
+ define(`__OSTYPE__', $1)
+ define(`_ARG_', $2)
+ include(_CF_DIR_`'ostype/$1.m4)POPDIVERT`'')
+ define(`MAILER',
+ `ifdef(`_MAILER_$1_', `dnl`'',
+ `define(`_MAILER_$1_', `')PUSHDIVERT(7)include(_CF_DIR_`'mailer/$1.m4)POPDIVERT`'')')
+! define(`DOMAIN', `PUSHDIVERT(-1)define(`_ARG_', $2)include(_CF_DIR_`'domain/$1.m4)POPDIVERT`'')
+! define(`FEATURE', `PUSHDIVERT(-1)define(`_ARG_', $2)include(_CF_DIR_`'feature/$1.m4)POPDIVERT`'')
+! define(`HACK', `PUSHDIVERT(-1)define(`_ARG_', $2)include(_CF_DIR_`'hack/$1.m4)POPDIVERT`'')
+ define(`VERSIONID', ``##### $1 #####'')
+ define(`LOCAL_RULE_0', `divert(3)')
+ define(`LOCAL_RULE_1',
+--- 41,73 ----
+ define(`__OSTYPE__', $1)
+ define(`_ARG_', $2)
+ include(_CF_DIR_`'ostype/$1.m4)POPDIVERT`'')
++ ## new FEATUREs
++ define(`_RBL_R_',`')
++ ## access to further arguments in FEATURE/HACK
++ define(`_ACC_ARG_1_',`$1')
++ define(`_ACC_ARG_2_',`$2')
++ define(`_ACC_ARG_3_',`$3')
++ define(`_ACC_ARG_4_',`$4')
++ define(`_ACC_ARG_5_',`$5')
++ define(`_ACC_ARG_6_',`$6')
++ define(`_ACC_ARG_7_',`$7')
++ define(`_ACC_ARG_8_',`$8')
++ define(`_ACC_ARG_9_',`$9')
++ define(`_ARG1_',`_ACC_ARG_1_(_ARGS_)')
++ define(`_ARG2_',`_ACC_ARG_2_(_ARGS_)')
++ define(`_ARG3_',`_ACC_ARG_3_(_ARGS_)')
++ define(`_ARG4_',`_ACC_ARG_4_(_ARGS_)')
++ define(`_ARG5_',`_ACC_ARG_5_(_ARGS_)')
++ define(`_ARG6_',`_ACC_ARG_6_(_ARGS_)')
++ define(`_ARG7_',`_ACC_ARG_7_(_ARGS_)')
++ define(`_ARG8_',`_ACC_ARG_8_(_ARGS_)')
++ define(`_ARG9_',`_ACC_ARG_9_(_ARGS_)')
+ define(`MAILER',
+ `ifdef(`_MAILER_$1_', `dnl`'',
+ `define(`_MAILER_$1_', `')PUSHDIVERT(7)include(_CF_DIR_`'mailer/$1.m4)POPDIVERT`'')')
+! define(`DOMAIN', `PUSHDIVERT(-1)define(`_ARG_', `$2')include(_CF_DIR_`'domain/$1.m4)POPDIVERT`'')
+! define(`FEATURE', `PUSHDIVERT(-1)define(`_ARG_', `$2')define(`_ARGS_', `shift($@)')include(_CF_DIR_`'feature/$1.m4)POPDIVERT`'')
+! define(`HACK', `PUSHDIVERT(-1)define(`_ARG_', `$2')define(`_ARGS_', `shift($@)')include(_CF_DIR_`'hack/$1.m4)POPDIVERT`'')
+ define(`VERSIONID', ``##### $1 #####'')
+ define(`LOCAL_RULE_0', `divert(3)')
+ define(`LOCAL_RULE_1',
+diff -cr ./m4/proto.m4 /home/ca/smi/sendmail/cf/m4/proto.m4
+*** ./m4/proto.m4 Tue Feb 2 15:21:30 1999
+--- /home/ca/smi/sendmail/cf/m4/proto.m4 Sat Feb 20 13:58:33 1999
+***************
+*** 1,6 ****
+ divert(-1)
+ #
+! # Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
+ # Copyright (c) 1988, 1993
+ # The Regents of the University of California. All rights reserved.
+--- 1,7 ----
+ divert(-1)
+ #
+! # Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
+! # All rights reserved.
+ # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
+ # Copyright (c) 1988, 1993
+ # The Regents of the University of California. All rights reserved.
+***************
+*** 12,18 ****
+ #
+ divert(0)
+
+! VERSIONID(`@(#)proto.m4 8.243 (Berkeley) 2/2/1999')
+
+ MAILER(local)dnl
+
+--- 13,19 ----
+ #
+ divert(0)
+
+! VERSIONID(`$Id: proto.m4,v 8.247 1999/02/20 21:58:33 ca Exp $')
+
+ MAILER(local)dnl
+
+***************
+*** 1108,1120 ****
+ R<DISCARD> $* $#discard $: discard
+ R<$+> $* $#error $@ 5.7.1 $: $1', `dnl')
+
+! ifdef(`_RBL_', `dnl
+! # DNS based IP address spam lists
+! R$* $: $&{client_addr}
+! R$-.$-.$-.$- $: $(host $4.$3.$2.$1._RBL_. $: OK $)
+! ROK $@ OK
+! R$+ $#error $@ 5.7.1 $: "Mail from " $&{client_addr} " refused by blackhole site _RBL_"',
+! `dnl')
+
+ ######################################################################
+ ### check_mail -- check SMTP ``MAIL FROM:'' command argument
+--- 1109,1115 ----
+ R<DISCARD> $* $#discard $: discard
+ R<$+> $* $#error $@ 5.7.1 $: $1', `dnl')
+
+! _RBL_R_
+
+ ######################################################################
+ ### check_mail -- check SMTP ``MAIL FROM:'' command argument
diff --git a/debian/patches/mrbl.p3.README b/debian/patches/mrbl.p3.README
new file mode 100644
index 0000000..313795c
--- /dev/null
+++ b/debian/patches/mrbl.p3.README
@@ -0,0 +1,12 @@
+
+Upgrade to 8.9.3, and install the multiple rbl patch from:
+ http://www.Sendmail.ORG/~ca/email/patches/mrbl.p3
+ http://www.sendmail.org
+Then use
+ FEATURE(rbl,`rbl.maps.vix.com',` Mail from $&{client_addr}
+ rejected - rbl; see http://maps.vix.com')
+ FEATURE(rbl,`dul.maps.vix.com',` Mail from $&{client_addr}
+ rejected - dul; see http://maps.vix.com')
+ FEATURE(rbl,`relays.orbs.org',` Mail from $&{client_addr}
+ rejected - open relay; see http://www.orbs.org')
+
diff --git a/debian/patches/patch.DOS b/debian/patches/patch.DOS
new file mode 100644
index 0000000..7b595b9
--- /dev/null
+++ b/debian/patches/patch.DOS
@@ -0,0 +1,21 @@
+--- main.c~orig Sat Jan 9 15:31:13 1999
++++ main.c Wed Nov 17 19:04:44 1999
+@@ -984,6 +984,18 @@
+ usrerr("Permission denied");
+ finis(FALSE, EX_USAGE);
+ }
++ if (OpMode == MD_INITALIAS &&
++ RealUid != 0 &&
++ RealUid != TrustedUid &&
++ !wordinclass(RealUserName, 't'))
++ {
++ if (LogLevel > 1)
++ sm_syslog(LOG_ALERT, NOQID,
++ "user %d attempted to rebuild the alias map",
++ RealUid);
++ usrerr("Permission denied");
++ finis(FALSE, EX_USAGE);
++ }
+
+ if (MeToo)
+ BlankEnvelope.e_flags |= EF_METOO;
diff --git a/debian/patches/patch.IP_SRCROUTE b/debian/patches/patch.IP_SRCROUTE
new file mode 100644
index 0000000..84b7ee8
--- /dev/null
+++ b/debian/patches/patch.IP_SRCROUTE
@@ -0,0 +1,94 @@
+*** ../../src/conf.h Mon Apr 12 15:12:30 1999
+--- conf.h Thu Apr 8 15:35:20 1999
+***************
+*** 1284,1290 ****
+ # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
+ # define GIDSET_T gid_t /* from <linux/types.h> */
+ # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */
+! # define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */
+ # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
+ # ifndef HASFLOCK
+ # include <linux/version.h>
+--- 1284,1290 ----
+ # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
+ # define GIDSET_T gid_t /* from <linux/types.h> */
+ # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */
+! # define IP_SRCROUTE 1 /* linux <= 1.2.8 doesn't support IP_OPTIONS */
+ # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
+ # ifndef HASFLOCK
+ # include <linux/version.h>
+*** ../../src/daemon.c Mon Apr 12 15:12:30 1999
+--- daemon.c Mon Apr 12 15:37:50 1999
+***************
+*** 42,48 ****
+ # if IP_SRCROUTE
+ # include <netinet/in_systm.h>
+ # include <netinet/ip.h>
+! # include <netinet/ip_var.h>
+ # endif
+
+ /*
+--- 42,50 ----
+ # if IP_SRCROUTE
+ # include <netinet/in_systm.h>
+ # include <netinet/ip.h>
+! # ifndef __linux__
+! # include <netinet/ip_var.h>
+! # endif
+ # endif
+
+ /*
+***************
+*** 1570,1584 ****
+ u_char *o;
+ int l;
+ struct in_addr addr;
+ struct ipoption ipopt;
+!
+ ipoptlen = sizeof ipopt;
+ if (getsockopt(fd, IPPROTO_IP, IP_OPTIONS,
+ (char *) &ipopt, &ipoptlen) < 0)
+ goto noipsr;
+ if (ipoptlen == 0)
+ goto noipsr;
+ o = (u_char *) ipopt.ipopt_list;
+ while (o != NULL && o < (u_char *) &ipopt + ipoptlen)
+ {
+ switch (*o)
+--- 1572,1593 ----
+ u_char *o;
+ int l;
+ struct in_addr addr;
++ # ifndef __linux__
+ struct ipoption ipopt;
+! # else
+! struct ip_options ipopt;
+! # endif
+ ipoptlen = sizeof ipopt;
+ if (getsockopt(fd, IPPROTO_IP, IP_OPTIONS,
+ (char *) &ipopt, &ipoptlen) < 0)
+ goto noipsr;
+ if (ipoptlen == 0)
+ goto noipsr;
++ # ifndef __linux__
+ o = (u_char *) ipopt.ipopt_list;
++ # else
++ o = (u_char *) ipopt.__data;
++ # endif
+ while (o != NULL && o < (u_char *) &ipopt + ipoptlen)
+ {
+ switch (*o)
+***************
+*** 1609,1615 ****
+--- 1618,1628 ----
+ snprintf(p, SPACELEFT(hbuf, p), " [%s@%.*s",
+ *o == IPOPT_SSRR ? "!" : "",
+ l > 240 ? 120 : l / 2,
++ # ifndef __linux__
+ inet_ntoa(GET_IPOPT_DST(ipopt.ipopt_dst)));
++ # else
++ ipopt.faddr);
++ # endif
+ i = strlen(p);
+ p += i;
+ l -= strlen(p);
diff --git a/debian/patches/patch.dont_masquerade_local b/debian/patches/patch.dont_masquerade_local
new file mode 100644
index 0000000..f4484b9
--- /dev/null
+++ b/debian/patches/patch.dont_masquerade_local
@@ -0,0 +1,39 @@
+diff -cr ../../cf/mailer/local.m4 local.m4
+*** ../../cf/mailer/local.m4 Thu Apr 22 18:23:05 1999
+--- local.m4 Thu Apr 22 18:40:37 1999
+***************
+*** 39,45 ****
+ R<@> $n errors to mailer-daemon
+ R@ <@ $*> $n temporarily bypass Sun bogosity
+ R$+ $: $>50 $1 add local domain if needed
+! R$* $: $>94 $1 do masquerading
+
+ #
+ # Envelope recipient rewriting
+--- 39,46 ----
+ R<@> $n errors to mailer-daemon
+ R@ <@ $*> $n temporarily bypass Sun bogosity
+ R$+ $: $>50 $1 add local domain if needed
+! ifdef(`_DONT_MASQUERADE_LOCAL_', `dnl', `dnl
+! R$* $: $>94 $1 do masquerading')
+
+ #
+ # Envelope recipient rewriting
+***************
+*** 54,60 ****
+ R<@> $n errors to mailer-daemon
+ R@ <@ $*> $n temporarily bypass Sun bogosity
+ R$+ $: $>50 $1 add local domain if needed
+! R$* $: $>93 $1 do masquerading
+
+ #
+ # Header recipient rewriting
+--- 55,62 ----
+ R<@> $n errors to mailer-daemon
+ R@ <@ $*> $n temporarily bypass Sun bogosity
+ R$+ $: $>50 $1 add local domain if needed
+! ifdef(`_DONT_MASQUERADE_LOCAL_', `dnl', `dnl
+! R$* $: $>93 $1 do masquerading')
+
+ #
+ # Header recipient rewriting
diff --git a/debian/patches/patch.ldap.m4 b/debian/patches/patch.ldap.m4
new file mode 100644
index 0000000..823bc13
--- /dev/null
+++ b/debian/patches/patch.ldap.m4
@@ -0,0 +1,17 @@
+*** ../../cf/m4/proto.m4 Thu Apr 22 18:23:04 1999
+--- proto.m4 Fri Apr 23 11:41:47 1999
+***************
+*** 870,875 ****
+--- 870,881 ----
+ R< $* . > $+ $: < $1 > $2 strip extra dot',
+ `dnl')
+
++ ifdef(`_LDAP_MAP_', `dnl
++ # Now attempt to lookup in ldap (ldap map)
++ R< $L > $+ $: < $L > $( ldap $1 $) look up user
++ R< $* > $+ @ $+ $: < $3 > $2 Rewrite if forward',
++ `dnl')
++
+ # see if we have a relay or a hub
+ R< > $+ $: < $H > $1 try hub
+ R< > $+ $: < $R > $1 try relay
diff --git a/debian/patches/patch.ldap.src b/debian/patches/patch.ldap.src
new file mode 100644
index 0000000..4b4a4df
--- /dev/null
+++ b/debian/patches/patch.ldap.src
@@ -0,0 +1,377 @@
+Index: ldap_map.h
+===================================================================
+RCS file: /usr/local/src/cvsroot/sendmail.8.9/src/ldap_map.h,v
+retrieving revision 1.1.1.8
+retrieving revision 1.9
+diff -u -r1.1.1.8 -r1.9
+--- ldap_map.h 1999/02/15 19:35:30 1.1.1.8
++++ ldap_map.h 1999/02/15 20:04:06 1.9
+@@ -37,8 +37,8 @@
+ /* args for ldap_bind_s */
+ LDAP *ld;
+ char *binddn;
+- char *passwd;
+- int method;
++ char *secret;
++ int method;
+
+ /* args for ldap_search_st */
+ char *base;
+@@ -55,13 +55,32 @@
+ #define DEFAULT_LDAP_MAP_PORT LDAP_PORT
+ #define DEFAULT_LDAP_MAP_SCOPE LDAP_SCOPE_SUBTREE
+ #define DEFAULT_LDAP_MAP_BINDDN NULL
+-#define DEFAULT_LDAP_MAP_PASSWD NULL
++#define DEFAULT_LDAP_MAP_SECRET NULL
+ #define DEFAULT_LDAP_MAP_METHOD LDAP_AUTH_SIMPLE
+ #define DEFAULT_LDAP_MAP_TIMELIMIT 5
+ #define DEFAULT_LDAP_MAP_DEREF LDAP_DEREF_NEVER
+ #define DEFAULT_LDAP_MAP_SIZELIMIT 0
+ #define DEFAULT_LDAP_MAP_ATTRSONLY 0
+ #define LDAP_MAP_MAX_FILTER 1024
++
++/* authentication methods available */
++
++#define LDAP_MAP_AUTH_METHOD_MAX 3
++#define LDAP_MAP_MAX_PASSWD 256
++
++char *ldap_map_auth_methods[] = {
++ "LDAP_AUTH_NONE",
++ "LDAP_AUTH_SIMPLE",
++ "LDAP_AUTH_KRBV4"
++} ;
++
++int ldap_map_auth_methods_code[LDAP_MAP_AUTH_METHOD_MAX] = {
++ LDAP_AUTH_NONE,
++ LDAP_AUTH_SIMPLE,
++ LDAP_AUTH_KRBV4
++} ;
++
++
+ #ifdef LDAP_REFERRALS
+ # define DEFAULT_LDAP_MAP_LDAP_OPTIONS LDAP_OPT_REFERRALS
+ #else /* LDAP_REFERRALS */
+Index: map.c
+===================================================================
+RCS file: /usr/local/src/cvsroot/sendmail.8.9/src/map.c,v
+retrieving revision 1.1.1.11
+retrieving revision 1.20
+diff -u -r1.1.1.11 -r1.20
+--- map.c 1999/02/15 19:35:31 1.1.1.11
++++ map.c 1999/03/30 21:22:41 1.20
+@@ -2621,6 +2621,10 @@
+ #endif
+ return FALSE;
+ }
++ /* We could call aliaswait here, but it only adds extra
++ code to the ldap map lookup. The aliaswait "@:@" convention
++ does not make much sense in the ldap tcp-based model.
++ */
+ return TRUE;
+ }
+
+@@ -2647,7 +2651,7 @@
+ LDAP_MAP_STRUCT *lmap;
+ LDAP *ld;
+ register EVENT *ev = NULL;
+-
++ register int bind_result;
+ if (tTd(38, 2))
+ printf("ldap_map_start(%s)\n", map->map_mname);
+
+@@ -2713,12 +2717,12 @@
+ lmap->ld = ld;
+ return TRUE;
+ #else
+- if (ldap_bind_s(ld, lmap->binddn,lmap->passwd,lmap->method) != LDAP_SUCCESS)
++ if (ldap_bind_s(ld, lmap->binddn,lmap->secret,lmap->method) != LDAP_SUCCESS)
+ {
+ if (!bitset(MF_OPTIONAL, map->map_mflags))
+ {
+- syserr("421 Cannot bind to map %s in ldap server %s",
+- map->map_mname, lmap->ldaphost);
++ syserr("421 Cannot bind to map %s in ldap server %s, %s",
++ map->map_mname, lmap->ldaphost,ldap_err2string(bind_result));
+ }
+ }
+ else
+@@ -2727,7 +2731,6 @@
+ lmap->ld = ld;
+ return TRUE;
+ }
+-
+ return FALSE;
+ #endif
+ }
+@@ -2811,13 +2814,13 @@
+ {
+ LDAP_MAP_STRUCT *lmap = NULL;
+ LDAPMessage *entry;
+- char *vp;
++ char *vp,*vp_tmp;
+ auto int vsize;
+ char keybuf[MAXNAME + 1];
+ char filter[LDAP_MAP_MAX_FILTER + 1];
+ char **attr_values = NULL;
+- char *result;
+- int name_len;
++ char *result,*tmp;
++ int name_len,val_count,i;
+ char *fp, *p, *q;
+
+ if (tTd(38, 20))
+@@ -2899,39 +2902,88 @@
+ }
+ }
+
++ result = NULL;
++ *statp = EX_NOTFOUND;
++
+ entry = ldap_first_entry(lmap->ld,lmap->res);
+ if (entry == NULL)
+ {
+- result = NULL;
+- *statp = EX_NOTFOUND;
+ goto quick_exit;
+ }
+
+- /* Need to build the args for map_rewrite here */
+- attr_values = ldap_get_values(lmap->ld,entry,lmap->attr[0]);
+- if (attr_values == NULL)
+- {
+- /* bad things happened */
+- result = NULL;
+- *statp = EX_NOTFOUND;
+- goto quick_exit;
++ vp = NULL ;
++
++ /* Cycle through all entries. */
++ do {
++ /* Need to build the args for map_rewrite here */
++ attr_values = ldap_get_values(lmap->ld,entry,lmap->attr[0]);
++ if (attr_values != NULL )
++ {
++ *statp = EX_OK;
++
++ /*
++ * If there is more that one munge then into
++ * a comma sep string
++ */
++ val_count = ldap_count_values(attr_values) ;
++ /* count size */
++ vsize = 0 ;
++ for( i = 0 ; i < val_count && attr_values[i] != NULL ; i++ ) {
++ vsize += strlen(attr_values[i]) + strlen(", ") ;
++ }
++ vp_tmp = (char * ) malloc(vsize) ;
++ if ( vp_tmp != NULL )
++ {
++ /* first */
++ snprintf(vp_tmp,vsize,"%s",attr_values[0]) ;
++ tmp = vp_tmp + strlen(vp_tmp);
++ /*rest */
++ for( i = 1 ; i < (val_count ) && attr_values[i] != NULL ; i++ ) {
++ snprintf(tmp,(vsize - strlen(vp_tmp)),", %s",attr_values[i]) ;
++ tmp = vp_tmp + strlen(vp_tmp) ;
++ }
++
++ } else {
++ /* Report memory error */
++ if (!bitset(MF_OPTIONAL, map->map_mflags))
++ {
++ syserr("Out of memory in ldap_map_lookup");
++ }
++ }
++ }
++ if ( vp == NULL )
++ {
++ vp = vp_tmp ;
++ } else {
++ vsize = strlen(vp) + strlen(vp_tmp) + strlen(", ") + 1 ;
++ tmp = ( char *) malloc( vsize ) ;
++ snprintf(tmp,vsize,"%s, %s",vp,vp_tmp) ;
++ /* Free things in correct order. */
++ free ( vp_tmp) ; /* vsize malloc above */
++ vp_tmp = vp ; /* tmp malloc from previous loop */
++ vp = tmp ;
++ free ( vp_tmp ) ;
++ }
++ ldap_value_free(attr_values);
++ attr_values = NULL ;
++
++ } while ( (entry = ldap_next_entry( lmap->ld, entry ) ) != NULL ) ;
++
++ if ( *statp == EX_OK ) {
++
++ vsize = strlen(vp);
++
++ if (LogLevel > 9)
++ sm_syslog(LOG_INFO, CurEnv->e_id,
++ "ldap %.100s => %s",
++ name, vp);
++ if (bitset(MF_MATCHONLY, map->map_mflags))
++ result = map_rewrite(map, name, strlen(name), NULL);
++ else
++ result = map_rewrite(map, vp, vsize, av);
++ free(vp) ;
++
+ }
+-
+- *statp = EX_OK;
+-
+- /* If there is more that one use the first */
+- vp = attr_values[0];
+- vsize = strlen(vp);
+-
+- if (LogLevel > 9)
+- sm_syslog(LOG_INFO, CurEnv->e_id,
+- "ldap %.100s => %s",
+- name, vp);
+- if (bitset(MF_MATCHONLY, map->map_mflags))
+- result = map_rewrite(map, name, strlen(name), NULL);
+- else
+- result = map_rewrite(map, vp, vsize, av);
+-
+ quick_exit:
+ if (attr_values != NULL)
+ ldap_value_free(attr_values);
+@@ -2982,8 +3034,12 @@
+ char *args;
+ {
+ register char *p = args;
+- register int done;
++ register int done,i;
+ LDAP_MAP_STRUCT *lmap;
++ static char m_tmp[MAXPATHLEN+LDAP_MAP_MAX_PASSWD];
++ FILE * sfd ;
++ int sff = SFF_OPENASROOT|SFF_ROOTOK|SFF_NOWLINK|SFF_NOWWFILES|SFF_NOGWFILES;
++ char *tmp ;
+
+ /* We need to alloc an LDAP_MAP_STRUCT struct */
+ lmap = (LDAP_MAP_STRUCT *) xalloc(sizeof(LDAP_MAP_STRUCT));
+@@ -3002,7 +3058,8 @@
+
+ /* Default char ptrs to NULL */
+ lmap->binddn = NULL;
+- lmap->passwd = NULL;
++
++ lmap->secret = NULL;
+ lmap->base = NULL;
+ lmap->ldaphost = NULL;
+
+@@ -3088,7 +3145,9 @@
+ break;
+
+ case 's': /* search scope */
+- if (strncasecmp(++p, "base", 4) == 0)
++ while (isascii(*++p) && isspace(*p))
++ continue;
++ if (strncasecmp(p, "base", 4) == 0)
+ {
+ lmap->scope = LDAP_SCOPE_BASE;
+ }
+@@ -3142,7 +3201,36 @@
+ lmap->timelimit = atoi(p);
+ lmap->timeout.tv_sec = lmap->timelimit;
+ break;
+-
++ case 'D': /* Dn to bind to server as */
++ while (isascii(*++p) && isspace(*p))
++ continue;
++ lmap->binddn = p;
++ break;
++ case 'M': /* Method for binding */
++ while (isascii(*++p) && isspace(*p))
++ continue;
++ /* Need to map ascii method to int here */
++ tmp = p ;
++ /* Argh, can't use ldap_map_dequote here */
++ if ( *tmp == '"' ) {
++ while ( isascii(*++tmp) && isspace(*tmp))
++ continue;
++ }
++ for(i = 0 ; i < LDAP_MAP_AUTH_METHOD_MAX ; i++ ) {
++ if ( strncmp(tmp,ldap_map_auth_methods[i],strlen(ldap_map_auth_methods[i])) == 0 ) {
++ lmap->method = ldap_map_auth_methods_code[i] ;
++ }
++ }
++
++ break ;
++ /* This is a string that is dependent on the
++ * method used defined above.
++ */
++ case 'S': /* Secret for binding */
++ while (isascii(*++p) && isspace(*p))
++ continue;
++ lmap->secret = p ;
++ break ;
+ }
+
+ /* need to account for quoted strings here arggg... */
+@@ -3189,16 +3277,60 @@
+ return FALSE;
+ }
+
+- if (lmap->binddn != NULL)
+- lmap->binddn = newstr(ldap_map_dequote(lmap->binddn));
++ if (lmap->binddn != NULL) {
++ lmap->binddn = newstr(ldap_map_dequote(lmap->binddn));
++
++ if ( lmap->secret != NULL ) {
++ /* need to use method to map secret to passwd string */
++ switch(lmap->method)
++ {
++
++ case LDAP_AUTH_NONE: /* Do nothing */
++ break;
++ case LDAP_AUTH_SIMPLE: /* Secret is the name of a file with
++ the first line as the pwd. */
++
++
++ sfd = safefopen(ldap_map_dequote(lmap->secret),O_RDONLY,0,sff);
++ if ( sfd == NULL )
++ {
++ syserr("LDAP map: cannot open secret %s",ldap_map_dequote(lmap->secret));
++ return FALSE ;
++ } else
++ {
++ lmap->secret = sfgets(m_tmp,LDAP_MAP_MAX_PASSWD,sfd,0,"ldap_map_parseargs") ;
++ fclose(sfd) ;
++ if ( lmap->secret != NULL )
++ {
++ /* chomp newline */
++ if (m_tmp[strlen(m_tmp)-1] == '\n')
++ m_tmp[strlen(m_tmp)-1] = '\0';
++
++ lmap->secret = newstr(m_tmp) ;
++ }
++ }
++ break ;
++ case LDAP_AUTH_KRBV4: /* Secret is where the tgt file
++ is stashed */
++ /* We could be paranoid here.. */
++ snprintf(m_tmp,MAXPATHLEN+LDAP_MAP_MAX_PASSWD,"KRBTKFILE=%s",ldap_map_dequote(lmap->secret));
++ putenv(m_tmp);
++ lmap->secret = NULL ;
++ break ;
++ default : /* Should NEVER get here */
++ syserr("LDAP map: Garbage in lmap method" ) ;
++ return FALSE ;
++ break ;
++ } /* end switch */
++ }
++ }
+ else
+ lmap->binddn = DEFAULT_LDAP_MAP_BINDDN;
+-
+
+- if (lmap->passwd != NULL)
+- lmap->passwd = newstr(ldap_map_dequote(lmap->passwd));
++ if (lmap->secret != NULL)
++ lmap->secret = newstr(ldap_map_dequote(lmap->secret));
+ else
+- lmap->passwd = DEFAULT_LDAP_MAP_PASSWD;
++ lmap->secret = DEFAULT_LDAP_MAP_SECRET;
+
+ if (lmap->base != NULL)
+ lmap->base = newstr(ldap_map_dequote(lmap->base));
diff --git a/debian/patches/patch.local_procmail b/debian/patches/patch.local_procmail
new file mode 100644
index 0000000..df6ea83
--- /dev/null
+++ b/debian/patches/patch.local_procmail
@@ -0,0 +1,68 @@
+# Make sure FEATURE(local_procmail) comes before MAILER(local)
+#
+# To apply this patch:
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'applypatch' program with this patch file as input.
+#
+# If you do not have 'applypatch', it is part of the 'makepatch' package
+# that you can fetch from the Comprehensive Perl Archive Network:
+# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
+# In the above URL, 'x' should be 2 or higher.
+#
+# To apply this patch without the use of 'applypatch':
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'patch' program with this file as input.
+#
+#### End of Preamble ####
+
+#### Patch data follows ####
+diff -c '../../cf/feature/local_procmail.m4' 'local_procmail.m4'
+Index: ./../../cf/feature/local_procmail.m4
+*** ./../../cf/feature/local_procmail.m4 Mon Jul 19 15:45:59 1999
+--- ./local_procmail.m4 Mon Jul 19 15:46:56 1999
+***************
+*** 12,20 ****
+ #
+
+ divert(0)
+! VERSIONID(`@(#)local_procmail.m4 8.11 (Berkeley) 5/19/1998')
+ divert(-1)
+
+ define(`LOCAL_MAILER_PATH',
+ ifelse(_ARG_, `',
+ ifdef(`PROCMAIL_MAILER_PATH',
+--- 12,22 ----
+ #
+
+ divert(0)
+! VERSIONID(`@(#)local_procmail.m4 8.13 (Debian) 7/19/1999')
+ divert(-1)
+
++ ifdef(`_MAILER_local_',
++ `errprint(`*** FEATURE(local_procmail) must occur before MAILER(local)')')dnl
+ define(`LOCAL_MAILER_PATH',
+ ifelse(_ARG_, `',
+ ifdef(`PROCMAIL_MAILER_PATH',
+***************
+*** 22,25 ****
+ `/usr/local/bin/procmail'),
+ _ARG_))
+ define(`LOCAL_MAILER_FLAGS', `SPfhn9')
+! define(`LOCAL_MAILER_ARGS', `procmail -Y -a $h -d $u')
+--- 24,27 ----
+ `/usr/local/bin/procmail'),
+ _ARG_))
+ define(`LOCAL_MAILER_FLAGS', `SPfhn9')
+! define(`LOCAL_MAILER_ARGS', `procmail -a $h -d $u')
+#### End of Patch data ####
+
+#### ApplyPatch data follows ####
+# Data version : 1.0
+# Date generated : Mon Jul 19 15:59:28 1999
+# Generated by : makepatch 2.00
+# Recurse directories : Yes
+# p '../../cf/feature/local_procmail.m4' 715
+#### End of ApplyPatch data ####
+
+#### End of Patch kit [created: Mon Jul 19 15:59:28 1999] ####
+#### Checksum: 68 2121 26700 ####
diff --git a/debian/patches/patch.mail.local b/debian/patches/patch.mail.local
new file mode 100644
index 0000000..d0c8b0d
--- /dev/null
+++ b/debian/patches/patch.mail.local
@@ -0,0 +1,68 @@
+diff -wur ./mail.local/mail.local.c ./debian/patches/mail.local/mail.local.c
+--- ./mail.local/mail.local.c Tue Dec 29 18:42:53 1998
++++ ./debian/patches/mail.local/mail.local.c Sun May 7 17:30:14 2000
+@@ -593,6 +593,7 @@
+ FILE *fp = NULL;
+ time_t tval;
+ int fd, eline;
++ int prevfl, fl = 1;
+ char line[2048];
+ char tmpbuf[sizeof _PATH_LOCTMP + 1];
+
+@@ -620,12 +621,13 @@
+ for (eline = 1; fgets(line, sizeof(line), stdin);) {
+ size_t line_len = strlen(line);
+
++ prevfl=fl;
+ if (line_len >= 2 &&
+ line[line_len - 2] == '\r' &&
+ line[line_len - 1] == '\n') {
+ strcpy(line + line_len - 2, "\n");
+ }
+- if (lmtprcpts && line[0] == '.') {
++ if (prevfl && lmtprcpts && line[0] == '.') {
+ char *src = line + 1, *dest = line;
+
+ if (line[1] == '\n')
+@@ -634,7 +636,39 @@
+ *dest++ = *src++;
+ *dest = '\0';
+ }
+- if (line[0] == '\n')
++
++ fl=0;
++ if (line_len > 0)
++ {
++ if (line[line_len - 1] == '\n')
++ {
++ if (line_len >= 2 &&
++ line[line_len - 2] == '\r')
++ {
++ line[line_len - 2] = '\n';
++ line[line_len - 1] = '\0';
++ line_len--;
++ }
++ fl = 1;
++ }
++ else if (line[line_len - 1] == '\r')
++ {
++ int peek;
++ /* Did we just miss the CRLF? */
++ peek = fgetc(stdin);
++ if (peek == '\n')
++ {
++ line[line_len - 1] = '\n';
++ fl = 1;
++ }
++ else
++ (void) ungetc(peek, stdin);
++ }
++ }
++ else
++ fl = 1;
++
++ if (prevfl && line[0] == '\n')
+ eline = 1;
+ else {
+ if (eline && line[0] == 'F' &&
+
diff --git a/debian/patches/patch.rmail b/debian/patches/patch.rmail
new file mode 100644
index 0000000..c42593d
--- /dev/null
+++ b/debian/patches/patch.rmail
@@ -0,0 +1,52 @@
+# Allow background delivery of mail, instead of queueing
+#
+# To apply this patch:
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'applypatch' program with this patch file as input.
+#
+# If you do not have 'applypatch', it is part of the 'makepatch' package
+# that you can fetch from the Comprehensive Perl Archive Network:
+# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
+# In the above URL, 'x' should be 2 or higher.
+#
+# To apply this patch without the use of 'applypatch':
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'patch' program with this file as input.
+#
+#### End of Preamble ####
+
+#### Patch data follows ####
+diff -c '../../rmail/rmail.c' 'rmail.c'
+Index: ./../../rmail/rmail.c
+Prereq: 8.18
+*** ./../../rmail/rmail.c Tue Dec 29 12:43:05 1998
+--- ./rmail.c Mon Sep 13 10:47:12 1999
+***************
+*** 273,279 ****
+ i = 0;
+ args[i++] = _PATH_SENDMAIL; /* Build sendmail's argument list. */
+ args[i++] = "-oee"; /* No errors, just status. */
+! args[i++] = "-odq"; /* Queue it, don't try to deliver. */
+ args[i++] = "-oi"; /* Ignore '.' on a line by itself. */
+
+ /* set from system and protocol used */
+--- 273,279 ----
+ i = 0;
+ args[i++] = _PATH_SENDMAIL; /* Build sendmail's argument list. */
+ args[i++] = "-oee"; /* No errors, just status. */
+! args[i++] = "-odi"; /* deliver in the foreground. */
+ args[i++] = "-oi"; /* Ignore '.' on a line by itself. */
+
+ /* set from system and protocol used */
+#### End of Patch data ####
+
+#### ApplyPatch data follows ####
+# Data version : 1.0
+# Date generated : Mon Sep 13 10:47:49 1999
+# Generated by : makepatch 2.00
+# Recurse directories : Yes
+# p '../../rmail/rmail.c' 10101
+#### End of ApplyPatch data ####
+
+#### End of Patch kit [created: Mon Sep 13 10:47:49 1999] ####
+#### Checksum: 51 1826 6572 ####
diff --git a/debian/patches/prescan.8.9.3.patch b/debian/patches/prescan.8.9.3.patch
new file mode 100644
index 0000000..03bb80c
--- /dev/null
+++ b/debian/patches/prescan.8.9.3.patch
@@ -0,0 +1,122 @@
+Index: conf.c
+===================================================================
+RCS file: /cvs/sendmail/conf.c,v
+retrieving revision 8.456
+retrieving revision 8.456.2.2
+diff -c -r8.456 -r8.456.2.2
+*** sendmail-8.9.3/src/conf.c 7 Feb 1999 07:26:35 -0000 8.456
+--- conf.c 28 Mar 2003 06:03:22 -0000 8.456.2.2
+***************
+*** 286,291 ****
+--- 286,293 ----
+ DontLockReadFiles = TRUE;
+ DoubleBounceAddr = "postmaster";
+ MaxHeadersLength = MAXHDRSLEN;
++ MaxMimeHeaderLength = MAXLINE;
++ MaxMimeFieldLength = MaxMimeHeaderLength / 2;
+ snprintf(buf, sizeof buf, "%s%sdead.letter",
+ _PATH_VARTMP,
+ _PATH_VARTMP[sizeof _PATH_VARTMP - 2] == '/' ? "" : "/");
+Index: parseaddr.c
+===================================================================
+RCS file: /cvs/sendmail/parseaddr.c,v
+retrieving revision 8.159
+retrieving revision 8.159.2.3
+diff -c -r8.159 -r8.159.2.3
+*** sendmail-8.9.3/src/parseaddr.c 7 Feb 1999 07:26:40 -0000 8.159
+--- parseaddr.c 27 Mar 2003 19:42:23 -0000 8.159.2.3
+***************
+*** 403,409 ****
+ };
+
+
+! # define NOCHAR -1 /* signal nothing in lookahead token */
+
+ char **
+ prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
+--- 403,409 ----
+ };
+
+
+! # define NOCHAR (-1) /* signal nothing in lookahead token */
+
+ char **
+ prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
+***************
+*** 486,491 ****
+--- 486,492 ----
+ /* see if there is room */
+ if (q >= &pvpbuf[pvpbsize - 5])
+ {
++ addrtoolong:
+ usrerr("553 Address too long");
+ if (strlen(addr) > (SIZE_T) MAXNAME)
+ addr[MAXNAME] = '\0';
+***************
+*** 497,507 ****
+ }
+
+ /* squirrel it away */
+ *q++ = c;
+ }
+
+ /* read a new input character */
+! c = *p++;
+ if (c == '\0')
+ {
+ /* diagnose and patch up bad syntax */
+--- 498,512 ----
+ }
+
+ /* squirrel it away */
++ #if !ALLOW_255
++ if ((char) c == (char) -1 && !tTd(82, 101))
++ c &= 0x7f;
++ #endif /* !ALLOW_255 */
+ *q++ = c;
+ }
+
+ /* read a new input character */
+! c = (*p++) & 0x00ff;
+ if (c == '\0')
+ {
+ /* diagnose and patch up bad syntax */
+***************
+*** 556,561 ****
+--- 561,569 ----
+ }
+ else if (c != '!' || state == QST)
+ {
++ /* see if there is room */
++ if (q >= &pvpbuf[pvpbsize - 5])
++ goto addrtoolong;
+ *q++ = '\\';
+ continue;
+ }
+***************
+*** 637,642 ****
+--- 645,653 ----
+ /* new token */
+ if (tok != q)
+ {
++ /* see if there is room */
++ if (q >= &pvpbuf[pvpbsize - 5])
++ goto addrtoolong;
+ *q++ = '\0';
+ if (tTd(22, 36))
+ {
+Index: version.c
+===================================================================
+*** sendmail-8.9.3/src/version.c Thu Feb 4 16:38:46 1999
+--- version.c Wed Mar 19 16:33:35 2003
+***************
+*** 14,17 ****
+ static char sccsid[] = "@(#)version.c 8.9.3.1 (Berkeley) 2/4/1999";
+ #endif /* not lint */
+
+! char Version[] = "8.9.3";
+--- 14,17 ----
+ static char sccsid[] = "@(#)version.c 8.9.3.1 (Berkeley) 2/4/1999";
+ #endif /* not lint */
+
+! char Version[] = "8.9.3p2";
diff --git a/debian/patches/proto.m4.8.9.3 b/debian/patches/proto.m4.8.9.3
new file mode 100644
index 0000000..fec4494
--- /dev/null
+++ b/debian/patches/proto.m4.8.9.3
@@ -0,0 +1,13 @@
+*** ./sendmail-8.9.3/cf/m4/proto.m4 Tue Feb 2 15:21:30 1999
+--- proto.m4.n Tue Dec 3 15:32:38 2002
+***************
+*** 1100,1105 ****
+--- 1100,1107 ----
+
+ ifdef(`ACCESS_TABLE', `dnl
+ R$+ $| $+ $: $>LookUpDomain < $1 > <?> < $2 >
++ # empty client_name
++ R $| $+ $: $>LookUpAddress < $1 > <?> < $1 >
+ R<?> < $+ > $: $>LookUpAddress < $1 > <?> < $1 >
+ R<?> < $+ > $: $1
+ R<OK> < $* > $@ OK
diff --git a/debian/patches/sendmail.8.9.3.security.cr.patch b/debian/patches/sendmail.8.9.3.security.cr.patch
new file mode 100644
index 0000000..394ddf6
--- /dev/null
+++ b/debian/patches/sendmail.8.9.3.security.cr.patch
@@ -0,0 +1,487 @@
+Index: headers.c
+===================================================================
+RCS file: /cvs/sendmail/headers.c,v
+retrieving revision 8.139
+retrieving revision 8.139.2.1
+diff -u -w -r8.139 -r8.139.2.1
+--- src/headers.c 7 Feb 1999 07:26:37 -0000 8.139
++++ src/headers.c 20 Jan 2003 18:51:34 -0000 8.139.2.1
+@@ -501,9 +501,10 @@
+ {
+ if (bitset(H_FROM, h->h_flags))
+ {
+- extern char *crackaddr __P((char *));
++ extern char *crackaddr __P((char *, ENVELOPE *));
+
+- expand(crackaddr(buf), buf, sizeof buf, e);
++ expand(crackaddr(buf, e), buf,
++ sizeof buf, e);
+ }
+ h->h_value = newstr(buf);
+ h->h_flags &= ~H_DEFAULT;
+@@ -803,7 +804,11 @@
+ ** it and replaces it with "$g". The parse is totally ad hoc
+ ** and isn't even guaranteed to leave something syntactically
+ ** identical to what it started with. However, it does leave
+-** something semantically identical.
++** something semantically identical if possible, else at least
++** syntactically correct.
++**
++** For example, it changes "Real Name <real@example.com> (Comment)"
++** to "Real Name <$g> (Comment)".
+ **
+ ** This algorithm has been cleaned up to handle a wider range
+ ** of cases -- notably quoted and backslash escaped strings.
+@@ -812,6 +817,7 @@
+ **
+ ** Parameters:
+ ** addr -- the address to be cracked.
++** e -- the current envelope.
+ **
+ ** Returns:
+ ** a pointer to the new version.
+@@ -824,28 +830,50 @@
+ ** be copied if it is to be reused.
+ */
+
++#define SM_HAVE_ROOM ((bp < buflim) && (buflim <= bufend))
++
++/*
++** Append a character to bp if we have room.
++** If not, punt and return $g.
++*/
++
++#define SM_APPEND_CHAR(c) \
++ do \
++ { \
++ if (SM_HAVE_ROOM) \
++ *bp++ = (c); \
++ else \
++ goto returng; \
++ } while (0)
++
++#if MAXNAME < 10
++ERROR MAXNAME must be at least 10
++#endif /* MAXNAME < 10 */
++
+ char *
+-crackaddr(addr)
++crackaddr(addr, e)
+ register char *addr;
++ ENVELOPE *e;
+ {
+ register char *p;
+ register char c;
+- int cmtlev;
+- int realcmtlev;
+- int anglelev, realanglelev;
+- int copylev;
+- int bracklev;
+- bool qmode;
+- bool realqmode;
+- bool skipping;
+- bool putgmac = FALSE;
+- bool quoteit = FALSE;
+- bool gotangle = FALSE;
+- bool gotcolon = FALSE;
++ int cmtlev; /* comment level in input string */
++ int realcmtlev; /* comment level in output string */
++ int anglelev; /* angle level in input string */
++ int copylev; /* 0 == in address, >0 copying */
++ int bracklev; /* bracket level for IPv6 addr check */
++ bool addangle; /* put closing angle in output */
++ bool qmode; /* quoting in original string? */
++ bool realqmode; /* quoting in output string? */
++ bool putgmac = FALSE; /* already wrote $g */
++ bool quoteit = FALSE; /* need to quote next character */
++ bool gotangle = FALSE; /* found first '<' */
++ bool gotcolon = FALSE; /* found a ':' */
+ register char *bp;
+ char *buflim;
+ char *bufhead;
+ char *addrhead;
++ char *bufend;
+ static char buf[MAXNAME + 1];
+
+ if (tTd(33, 1))
+@@ -860,25 +888,22 @@
+ ** adjusted later if we find them.
+ */
+
++ buflim = bufend = &buf[sizeof(buf) - 1];
+ bp = bufhead = buf;
+- buflim = &buf[sizeof buf - 7];
+ p = addrhead = addr;
+- copylev = anglelev = realanglelev = cmtlev = realcmtlev = 0;
++ copylev = anglelev = cmtlev = realcmtlev = 0;
+ bracklev = 0;
+- qmode = realqmode = FALSE;
++ qmode = realqmode = addangle = FALSE;
+
+ while ((c = *p++) != '\0')
+ {
+ /*
+- ** If the buffer is overful, go into a special "skipping"
+- ** mode that tries to keep legal syntax but doesn't actually
+- ** output things.
++ ** Try to keep legal syntax using spare buffer space
++ ** (maintained by buflim).
+ */
+
+- skipping = bp >= buflim;
+-
+- if (copylev > 0 && !skipping)
+- *bp++ = c;
++ if (copylev > 0)
++ SM_APPEND_CHAR(c);
+
+ /* check for backslash escapes */
+ if (c == '\\')
+@@ -893,8 +918,8 @@
+ p--;
+ goto putg;
+ }
+- if (copylev > 0 && !skipping)
+- *bp++ = c;
++ if (copylev > 0)
++ SM_APPEND_CHAR(c);
+ goto putg;
+ }
+
+@@ -902,8 +927,14 @@
+ if (c == '"' && cmtlev <= 0)
+ {
+ qmode = !qmode;
+- if (copylev > 0 && !skipping)
++ if (copylev > 0 && SM_HAVE_ROOM)
++ {
++ if (realqmode)
++ buflim--;
++ else
++ buflim++;
+ realqmode = !realqmode;
++ }
+ continue;
+ }
+ if (qmode)
+@@ -915,15 +946,15 @@
+ cmtlev++;
+
+ /* allow space for closing paren */
+- if (!skipping)
++ if (SM_HAVE_ROOM)
+ {
+ buflim--;
+ realcmtlev++;
+ if (copylev++ <= 0)
+ {
+ if (bp != bufhead)
+- *bp++ = ' ';
+- *bp++ = c;
++ SM_APPEND_CHAR(' ');
++ SM_APPEND_CHAR(c);
+ }
+ }
+ }
+@@ -933,7 +964,7 @@
+ {
+ cmtlev--;
+ copylev--;
+- if (!skipping)
++ if (SM_HAVE_ROOM)
+ {
+ realcmtlev--;
+ buflim++;
+@@ -944,7 +975,7 @@
+ else if (c == ')')
+ {
+ /* syntax error: unmatched ) */
+- if (copylev > 0 && !skipping)
++ if (copylev > 0 && SM_HAVE_ROOM)
+ bp--;
+ }
+
+@@ -962,7 +993,7 @@
+
+ /*
+ ** Check for DECnet phase IV ``::'' (host::user)
+- ** or ** DECnet phase V ``:.'' syntaxes. The latter
++ ** or DECnet phase V ``:.'' syntaxes. The latter
+ ** covers ``user@DEC:.tay.myhost'' and
+ ** ``DEC:.tay.myhost::user'' syntaxes (bletch).
+ */
+@@ -971,10 +1002,10 @@
+ {
+ if (cmtlev <= 0 && !qmode)
+ quoteit = TRUE;
+- if (copylev > 0 && !skipping)
++ if (copylev > 0)
+ {
+- *bp++ = c;
+- *bp++ = *p;
++ SM_APPEND_CHAR(c);
++ SM_APPEND_CHAR(*p);
+ }
+ p++;
+ goto putg;
+@@ -985,41 +1016,43 @@
+ bp = bufhead;
+ if (quoteit)
+ {
+- *bp++ = '"';
++ SM_APPEND_CHAR('"');
+
+ /* back up over the ':' and any spaces */
+ --p;
+- while (isascii(*--p) && isspace(*p))
++ while (p > addr &&
++ isascii(*--p) && isspace(*p))
+ continue;
+ p++;
+ }
+ for (q = addrhead; q < p; )
+ {
+ c = *q++;
+- if (bp < buflim)
+- {
+ if (quoteit && c == '"')
+- *bp++ = '\\';
+- *bp++ = c;
++ {
++ SM_APPEND_CHAR('\\');
++ SM_APPEND_CHAR(c);
+ }
++ else
++ SM_APPEND_CHAR(c);
+ }
+ if (quoteit)
+ {
+ if (bp == &bufhead[1])
+ bp--;
+ else
+- *bp++ = '"';
++ SM_APPEND_CHAR('"');
+ while ((c = *p++) != ':')
+- {
+- if (bp < buflim)
+- *bp++ = c;
+- }
+- *bp++ = c;
++ SM_APPEND_CHAR(c);
++ SM_APPEND_CHAR(c);
+ }
+
+ /* any trailing white space is part of group: */
+- while (isascii(*p) && isspace(*p) && bp < buflim)
+- *bp++ = *p++;
++ while (isascii(*p) && isspace(*p))
++ {
++ SM_APPEND_CHAR(*p);
++ p++;
++ }
+ copylev = 0;
+ putgmac = quoteit = FALSE;
+ bufhead = bp;
+@@ -1028,10 +1061,7 @@
+ }
+
+ if (c == ';' && copylev <= 0 && !ColonOkInAddr)
+- {
+- if (bp < buflim)
+- *bp++ = c;
+- }
++ SM_APPEND_CHAR(c);
+
+ /* check for characters that may have to be quoted */
+ if (strchr(MustQuoteChars, c) != NULL)
+@@ -1059,42 +1089,45 @@
+
+ /* oops -- have to change our mind */
+ anglelev = 1;
+- if (!skipping)
+- realanglelev = 1;
++ if (SM_HAVE_ROOM)
++ {
++ if (!addangle)
++ buflim--;
++ addangle = TRUE;
++ }
+
+ bp = bufhead;
+ if (quoteit)
+ {
+- *bp++ = '"';
++ SM_APPEND_CHAR('"');
+
+ /* back up over the '<' and any spaces */
+ --p;
+- while (isascii(*--p) && isspace(*p))
++ while (p > addr &&
++ isascii(*--p) && isspace(*p))
+ continue;
+ p++;
+ }
+ for (q = addrhead; q < p; )
+ {
+ c = *q++;
+- if (bp < buflim)
+- {
+ if (quoteit && c == '"')
+- *bp++ = '\\';
+- *bp++ = c;
++ {
++ SM_APPEND_CHAR('\\');
++ SM_APPEND_CHAR(c);
+ }
++ else
++ SM_APPEND_CHAR(c);
+ }
+ if (quoteit)
+ {
+ if (bp == &buf[1])
+ bp--;
+ else
+- *bp++ = '"';
++ SM_APPEND_CHAR('"');
+ while ((c = *p++) != '<')
+- {
+- if (bp < buflim)
+- *bp++ = c;
+- }
+- *bp++ = c;
++ SM_APPEND_CHAR(c);
++ SM_APPEND_CHAR(c);
+ }
+ copylev = 0;
+ putgmac = quoteit = FALSE;
+@@ -1106,13 +1139,14 @@
+ if (anglelev > 0)
+ {
+ anglelev--;
+- if (!skipping)
++ if (SM_HAVE_ROOM)
+ {
+- realanglelev--;
++ if (addangle)
+ buflim++;
++ addangle = FALSE;
+ }
+ }
+- else if (!skipping)
++ else if (SM_HAVE_ROOM)
+ {
+ /* syntax error: unmatched > */
+ if (copylev > 0)
+@@ -1121,7 +1155,7 @@
+ continue;
+ }
+ if (copylev++ <= 0)
+- *bp++ = c;
++ SM_APPEND_CHAR(c);
+ continue;
+ }
+
+@@ -1129,30 +1163,42 @@
+ putg:
+ if (copylev <= 0 && !putgmac)
+ {
+- if (bp > bufhead && bp[-1] == ')')
+- *bp++ = ' ';
+- *bp++ = MACROEXPAND;
+- *bp++ = 'g';
++ if (bp > buf && bp[-1] == ')')
++ SM_APPEND_CHAR(' ');
++ SM_APPEND_CHAR(MACROEXPAND);
++ SM_APPEND_CHAR('g');
+ putgmac = TRUE;
+ }
+ }
+
+ /* repair any syntactic damage */
+- if (realqmode)
++ if (realqmode && bp < bufend)
+ *bp++ = '"';
+- while (realcmtlev-- > 0)
++ while (realcmtlev-- > 0 && bp < bufend)
+ *bp++ = ')';
+- while (realanglelev-- > 0)
++ if (addangle && bp < bufend)
+ *bp++ = '>';
+- *bp++ = '\0';
++ *bp = '\0';
++ if (bp < bufend)
++ goto success;
+
++ returng:
++ /* String too long, punt */
++ buf[0] = '<';
++ buf[1] = MACROEXPAND;
++ buf[2]= 'g';
++ buf[3] = '>';
++ buf[4]= '\0';
++ sm_syslog(LOG_ALERT, e->e_id,
++ "Dropped invalid comments from header address");
++
++ success:
+ if (tTd(33, 1))
+ {
+ printf("crackaddr=>`");
+ xputs(buf);
+ printf("'\n");
+ }
+-
+ return (buf);
+ }
+ /*
+Index: main.c
+===================================================================
+RCS file: /cvs/sendmail/main.c,v
+retrieving revision 8.326
+retrieving revision 8.326.2.2
+diff -u -w -r8.326 -r8.326.2.2
+--- src/main.c 7 Feb 1999 07:43:59 -0000 8.326
++++ src/main.c 20 Jan 2003 18:51:34 -0000 8.326.2.2
+@@ -2349,7 +2349,7 @@
+ static int tryflags = RF_COPYNONE;
+ char exbuf[MAXLINE];
+ extern bool invalidaddr __P((char *, char *));
+- extern char *crackaddr __P((char *));
++ extern char *crackaddr __P((char *, ENVELOPE *));
+ extern void dump_class __P((STAB *, int));
+ extern void translate_dollars __P((char *));
+ extern void help __P((char *));
+@@ -2671,7 +2671,7 @@
+ printf("Usage: /parse address\n");
+ return;
+ }
+- q = crackaddr(p);
++ q = crackaddr(p, e);
+ printf("Cracked address = ");
+ xputs(q);
+ printf("\nParsing %s %s address\n",
+Index: parseaddr.c
+===================================================================
+RCS file: /cvs/sendmail/parseaddr.c,v
+retrieving revision 8.159
+retrieving revision 8.159.2.1
+diff -u -w -r8.159 -r8.159.2.1
+--- src/parseaddr.c 7 Feb 1999 07:26:40 -0000 8.159
++++ src/parseaddr.c 20 Jan 2003 18:51:35 -0000 8.159.2.1
+@@ -2053,7 +2053,7 @@
+ static char buf[MAXNAME + 1];
+ char lbuf[MAXNAME + 1];
+ char pvpbuf[PSBUFSIZE];
+- extern char *crackaddr __P((char *));
++ extern char *crackaddr __P((char *, ENVELOPE *));
+
+ if (tTd(12, 1))
+ printf("remotename(%s)\n", name);
+@@ -2076,7 +2076,7 @@
+ if (bitset(RF_CANONICAL, flags) || bitnset(M_NOCOMMENT, m->m_flags))
+ fancy = "\201g";
+ else
+- fancy = crackaddr(name);
++ fancy = crackaddr(name, e);
+
+ /*
+ ** Turn the name into canonical form.
diff --git a/debian/patches/src.conf.h.linux b/debian/patches/src.conf.h.linux
new file mode 100644
index 0000000..745cbce
--- /dev/null
+++ b/debian/patches/src.conf.h.linux
@@ -0,0 +1,54 @@
+diff -c './src/conf.h' 'conf.h'
+Index: ./src/conf.h
+Prereq: 8.385
+*** sendmail-8.9.3/src/conf.h Wed Jul 25 12:23:19 2001
+--- ./src/conf.h Tue Jul 31 16:33:50 2001
+***************
+*** 1274,1280 ****
+
+ #ifdef __linux__
+ # define BSD 1 /* include BSD defines */
+! # define USESETEUID 0 /* Have it due to POSIX, but doesn't work */
+ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */
+ # define HASUNAME 1 /* use System V uname(2) system call */
+ # define HASUNSETENV 1 /* has unsetenv(3) call */
+--- 1274,1280 ----
+
+ #ifdef __linux__
+ # define BSD 1 /* include BSD defines */
+! # define USESETEUID 1 /* Have it due to POSIX, but doesn't work */
+ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */
+ # define HASUNAME 1 /* use System V uname(2) system call */
+ # define HASUNSETENV 1 /* has unsetenv(3) call */
+***************
+*** 1283,1289 ****
+ # endif
+ # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
+ # define GIDSET_T gid_t /* from <linux/types.h> */
+! # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */
+ # define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */
+ # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
+ # ifndef HASFLOCK
+--- 1283,1289 ----
+ # endif
+ # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
+ # define GIDSET_T gid_t /* from <linux/types.h> */
+! # define HASGETUSERSHELL 1 /* getusershell(3) broken in Slackware 2.0 */
+ # define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */
+ # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
+ # ifndef HASFLOCK
+***************
+*** 1307,1312 ****
+--- 1307,1318 ----
+ # endif
+ # include <sys/sysmacros.h>
+ # undef atol /* wounded in <stdlib.h> */
++ # if !defined(KERNEL_VERSION) /* not defined in 2.0.x kernel series */
++ # define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
++ # endif /* !defined(KERNEL_VERSION) */
++ # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36))
++ # define HASFCHMOD 1 /* fchmod(2) */
++ # endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) */
+ #endif
+
+
diff --git a/debian/patches/util.c.893.patch b/debian/patches/util.c.893.patch
new file mode 100644
index 0000000..fb71fcd
--- /dev/null
+++ b/debian/patches/util.c.893.patch
@@ -0,0 +1,48 @@
+--- ./src/util.c.orig Fri Jan 22 07:18:40 1999
++++ sendmail-8.9.3/src/util.c Thu Apr 29 02:34:21 1999
+@@ -2086,6 +2086,8 @@
+ ProcListVec = npv;
+ }
+ ProcListVec[i].proc_pid = pid;
++ if (ProcListVec[i].proc_task != NULL)
++ free(ProcListVec[i].proc_task);
+ ProcListVec[i].proc_task = newstr(task);
+
+ /* if process adding itself, it's not a child */
+@@ -2142,11 +2144,6 @@
+ if (ProcListVec[i].proc_pid == pid)
+ {
+ ProcListVec[i].proc_pid = NO_PID;
+- if (ProcListVec[i].proc_task != NULL)
+- {
+- free(ProcListVec[i].proc_task);
+- ProcListVec[i].proc_task = NULL;
+- }
+ break;
+ }
+ }
+@@ -2172,11 +2169,6 @@
+ for (i = 1; i < ProcListSize; i++)
+ {
+ ProcListVec[i].proc_pid = NO_PID;
+- if (ProcListVec[i].proc_task != NULL)
+- {
+- free(ProcListVec[i].proc_task);
+- ProcListVec[i].proc_task = NULL;
+- }
+ }
+ CurChildren = 0;
+ }
+@@ -2207,11 +2199,6 @@
+ "proc_list_probe: lost pid %d",
+ (int) ProcListVec[i].proc_pid);
+ ProcListVec[i].proc_pid = NO_PID;
+- if (ProcListVec[i].proc_task != NULL)
+- {
+- free(ProcListVec[i].proc_task);
+- ProcListVec[i].proc_task = NULL;
+- }
+ CurChildren--;
+ }
+ }
+