From: Gurusamy Sarathy <gsar@ActiveState.com>
To: reveng@arc.net.au
cc: "'Scott'" <scott@entice.ca>, PerlMx@listserv.ActiveState.com
Subject: Re: [PerlMx] using SASL and the PMX supplied Sendmail 

On Wed, 02 Jun 2004 13:26:39 +1000, "Bryan Nolen" wrote:
>Yes, I know its just normal Sendmail, but there are enhancements built into
>the version that ships with PMX

Not really.  AFAIK, we've fed any bugfixes we've made in the past
to the sendmail.org folks and they have incorporated them into their
release as of 8.12.11.

>- my next question is - are these patches
>downloadable so we can built custom releases of sendmail that are still
>controllable from PMX?

Here are the source diffs used to build PureMessage-Sendmail.
Except for the envelope-from header addition (which is from
the FreeBSD ports tree), there are no real functional changes.

Apply using GNU patch like so:

    cd sendmail-8.12.11
    patch -p1 -N < this_file

I'll also make this available from:

    http://public.activestate.com/gsar/pmsendmail.patch

Also, we've also made some binary-compatible changes to libmilter
to make it extensible, but that is not relevant if you're only
interested in building sendmail.  That patch will be available at:

    http://public.activestate.com/gsar/pmlibmilter.patch


Gurusamy Sarathy
gsar@ActiveState.com
-----------------------------------8<-----------------------------------
--- sendmail-8.12.11/cf/m4/cfhead.m4	2003-12-04 18:26:47.000000000 -0800
+++ sendmail-8.12.11+/cf/m4/cfhead.m4	2004-03-04 11:54:31.000000000 -0800
@@ -268,7 +268,8 @@
 define(`_REC_FULL_AUTH_', `$.$?{auth_type}(user=${auth_authen} $?{auth_author}author=${auth_author} $.mech=${auth_type}')
 define(`_REC_HDR_', `$?sfrom $s $.$?_($?s$|from $.$_)')
 define(`_REC_END_', `for $u; $|;
-	$.$b')
+	$.$b$?g
+	(envelope-from $g)$.')
 define(`_REC_TLS_', `(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u')
 define(`_REC_BY_', `$.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}')
 define(`confRECEIVED_HEADER', `_REC_HDR_
--- sendmail-8.12.11/devtools/OS/AIX.4.3	2003-07-07 14:14:24.000000000 -0700
+++ sendmail-8.12.11+/devtools/OS/AIX.4.3	2004-03-04 11:54:31.000000000 -0800
@@ -6,7 +6,7 @@
 define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
 define(`confENVDEF', `-D_AIX4=40300')
 define(`confOPTIMIZE', `-O3 -qstrict')
-define(`confCC', `/usr/bin/xlc')
+define(`confCC', `/usr/bin/cc')
 define(`confLIBS', `-ldbm')
 define(`confINSTALL', `/usr/ucb/install')
 define(`confEBINDIR', `/usr/lib')
@@ -15,8 +15,8 @@
 define(`confLDOPTS', `-blibpath:/usr/lib:/lib')
 define(`confSM_OS_HEADER', `sm_os_aix')
 
-define(`confMTCCOPTS', `-D_THREAD_SAFE')
-define(`confMTLDOPTS', `-lpthread')
+define(`confMTCCOPTS', `-D_THREAD_SAFE -qthreaded')
+define(`confMTLDOPTS', `-lpthreads -lc_r')
 define(`confLDOPTS_SO', `-Wl,-G -Wl,-bexpall')
 
 define(`USE_ICONV',`
--- sendmail-8.12.11/devtools/OS/HP-UX.10.x	2002-03-21 15:59:25.000000000 -0800
+++ sendmail-8.12.11+/devtools/OS/HP-UX.10.x	2004-03-04 11:54:32.000000000 -0800
@@ -3,12 +3,12 @@
 dnl	DO NOT EDIT THIS FILE.
 dnl	Place personal settings in devtools/Site/site.config.m4
 
-define(`confCC', `cc -Aa')
+define(`confCC', `cc -Aa +z +DAportable')
 define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
 define(`confENVDEF', `-D_HPUX_SOURCE -DHPUX10 -DV4FS')
 define(`confSM_OS_HEADER', `sm_os_hp')
-define(`confOPTIMIZE', `+O3')
-define(`confLIBS', `-lndbm')
+define(`confOPTIMIZE', `+O2')
+define(`confLIBS', `-lndbm -lcma')
 define(`confSHELL', `/usr/bin/sh')
 define(`confINSTALL', `${BUILDBIN}/install.sh')
 define(`confSBINGRP', `mail')
--- sendmail-8.12.11/devtools/OS/HP-UX.11.x	2002-03-21 15:59:25.000000000 -0800
+++ sendmail-8.12.11+/devtools/OS/HP-UX.11.x	2004-03-04 11:54:32.000000000 -0800
@@ -4,8 +4,8 @@
 dnl	Place personal settings in devtools/Site/site.config.m4
 
 # +z is to generate position independant code
-define(`confCClibsmi', `cc -Ae +Z')
-define(`confCC', `cc -Ae')
+define(`confCClibsmi', `cc -Ae +Z +DAportable')
+define(`confCC', `cc -Ae +z +DAportable')
 define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
 define(`confENVDEF', `-DV4FS -DHPUX11')
 define(`confSM_OS_HEADER', `sm_os_hp')
--- sendmail-8.12.11/devtools/bin/configure.sh	2003-08-20 11:08:07.000000000 -0700
+++ sendmail-8.12.11+/devtools/bin/configure.sh	2004-03-04 11:54:32.000000000 -0800
@@ -129,7 +129,11 @@
 				fi
 				;;
 			esac
-			libs="$libs -l$l"
+			if test "X$l" = "Xdb" -a -f "$p/lib$l.a"; then
+			    libs="$libs $p/lib$l.a"
+			else
+			    libs="$libs -l$l"
+			fi
 			break
 		fi
 	done
--- sendmail-8.12.11/doc/op/Makefile	2002-01-07 14:24:36.000000000 -0800
+++ sendmail-8.12.11+/doc/op/Makefile	2004-03-04 11:54:32.000000000 -0800
@@ -2,7 +2,7 @@
 
 DIR=		smm/08.sendmailop
 SRCS=		op.me
-OBJS=		op.ps
+OBJS=		op.ps op.pdf op.txt
 MACROS=		-me
 ROFF_CMD=	groff
 PIC_CMD=	pic
--- sendmail-8.12.11/include/sm/string.h	2001-06-17 14:31:11.000000000 -0700
+++ sendmail-8.12.11+/include/sm/string.h	2004-03-04 11:54:34.000000000 -0800
@@ -23,12 +23,14 @@
 /* return number of bytes left in a buffer */
 #define SPACELEFT(buf, ptr)	(sizeof buf - ((ptr) - buf))
 
+#if !defined(sm_snprintf)
 extern int PRINTFLIKE(3, 4)
 sm_snprintf __P((
 	char *,
 	size_t,
 	const char *,
 	...));
+#endif
 
 extern bool
 sm_match __P((
--- sendmail-8.12.11/sendmail/milter.c	2003-12-01 15:57:44.000000000 -0800
+++ sendmail-8.12.11+/sendmail/milter.c	2004-03-04 11:54:36.000000000 -0800
@@ -2718,12 +2718,19 @@
 		{
 			if (tTd(64, 10))
 				sm_dprintf("Delete (noop) %s:\n", field);
+			if (MilterLogLevel > 8)
+				sm_syslog(LOG_INFO, e->e_id, "Milter change(delete,noop): header: %s",
+				  field);
 		}
 		else
 		{
 			/* treat modify value with no existing header as add */
 			if (tTd(64, 10))
 				sm_dprintf("Add %s: %s\n", field, val);
+			if (MilterLogLevel > 8)
+				sm_syslog(LOG_INFO, e->e_id, "Milter change(add): header: %s: %s",
+				  field, val);
+
 			addheader(newstr(field), val, H_USER, e);
 		}
 		return;
--- /dev/null	1969-12-31 16:00:00.000000000 -0800
+++ sendmail-8.12.11+/devtools/Site/site.config.m4	2004-03-04 11:54:32.000000000 -0800
@@ -0,0 +1,2 @@
+dnl Milter
+APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER=1')
End of Patch.
