diff -Naru sendmail-8.18.1/devtools/M4/UNIX/sharedlibrary.m4 sendmail-8.18.1-NEW/devtools/M4/UNIX/sharedlibrary.m4
--- sendmail-8.18.1/devtools/M4/UNIX/sharedlibrary.m4 1970-01-01 02:00:00.000000000 +0200
+++ sendmail-8.18.1-NEW/devtools/M4/UNIX/sharedlibrary.m4 2024-12-09 16:39:31.783208810 +0200
@@ -0,0 +1,46 @@
+divert(-1)
+#
+# Copyright (c) 1999-2001, 2006 Proofpoint, 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
+# the sendmail distribution.
+#
+#
+# Definitions for Makefile construction for sendmail
+#
+# $Id: library.m4,v 8.12 2013-11-22 20:51:23 ca Exp $
+#
+divert(0)dnl
+include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/links.m4')dnl
+bldLIST_PUSH_ITEM(`bldC_PRODUCTS', bldCURRENT_PRODUCT)dnl
+bldPUSH_TARGET(bldCURRENT_PRODUCT)dnl
+bldPUSH_INSTALL_TARGET(`install-'bldCURRENT_PRODUCT)dnl
+bldPUSH_CLEAN_TARGET(bldCURRENT_PRODUCT`-clean')dnl
+
+include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/defines.m4')
+
+divert(bldTARGETS_SECTION)
+ifdef(`conf_libmilter_SOMAJOR', `define(`conf_libmilter_SOVERSION', conf_libmilter_SOMAJOR)')dnl
+ifdef(`conf_libmilter_SOMINOR', `define(`conf_libmilter_SOVERSION', conf_libmilter_SOMAJOR.conf_libmilter_SOMINOR)')dnl
+ifdef(`conf_libmilter_SOPATCH', `define(`conf_libmilter_SOVERSION', conf_libmilter_SOMAJOR.conf_libmilter_SOMINOR.conf_libmilter_SOPATCH)')dnl
+
+ifdef(`conf_libmilter_SOMINOR', `define(`conf_libmilter_SONAME', `.conf_libmilter_SOMAJOR')', `define(conf_libmilter_SONAME, `')')dnl
+
+bldCURRENT_PRODUCT: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
+ ${CC} -shared -pthread ${CFLAGS} ${confCCOPTS} -fPIC ${confLDOPTS} ${LDOPTS_SO} -o bldCURRENT_PRODUCT.so.conf_libmilter_SOVERSION -Wl,-soname,bldCURRENT_PRODUCT.so.conf_libmilter_SOMAJOR ${bldCURRENT_PRODUCT`OBJS'}
+ ${LN} ${LNOPTS} bldCURRENT_PRODUCT.so.conf_libmilter_SOVERSION bldCURRENT_PRODUCT.so${conf_libmilter_SONAME}
+ ${LN} ${LNOPTS} bldCURRENT_PRODUCT.so.conf_libmilter_SOMAJOR bldCURRENT_PRODUCT.so
+ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
+
+install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT
+ifdef(`bldINSTALLABLE', ` ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${bldINSTALL_DIR`'LIBDIR} ]; then confMKDIR -p ${DESTDIR}${bldINSTALL_DIR`'LIBDIR}; else :; fi ')
+ ${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} bldCURRENT_PRODUCT.so.conf_libmilter_SOVERSION ${DESTDIR}${LIBDIR}
+ ${LN} ${LNOPTS} bldCURRENT_PRODUCT.so.conf_libmilter_SOVERSION ${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.so`'conf_libmilter_SONAME
+ ${LN} ${LNOPTS} bldCURRENT_PRODUCT.so.conf_libmilter_SOMAJOR ${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.so')
+
+bldCURRENT_PRODUCT-clean:
+ rm -f ${OBJS} bldCURRENT_PRODUCT.so* ${MANPAGES}
+
+divert(0)
diff -Naru sendmail-8.18.1/devtools/README sendmail-8.18.1-NEW/devtools/README
--- sendmail-8.18.1/devtools/README 2024-01-31 08:38:32.000000000 +0200
+++ sendmail-8.18.1-NEW/devtools/README 2024-12-09 16:38:33.148883550 +0200
@@ -51,6 +51,17 @@
and their defaults before referencing the appropriate OS definitions
are listed below.
+conf_libmilter_CUSTOM_SOMAJOR [empty] Define a custom (MAJOR) version
+ number N for a shared object
+ (libmilter.so.N).
+conf_libmilter_CUSTOM_SOMINOR [empty] Define a custom MINOR version number
+ N for a shared object (libmilter.x.N).
+ Requires a custom MAJOR version number.
+conf_libmilter_CUSTOM_SOPATCH [emtpy] Define a custom PATCHLEVEL version
+ number N for a shared object
+ (libmilter.x.x.N).
+ Requires a custom MAJOR and MINOR
+ version number.
confBEFORE [empty] Files to create before sendmail is
compiled. The methods must be defined
in the Makefile using PUSHDIVERT(3).
diff -Naru sendmail-8.18.1/libmilter/README sendmail-8.18.1-NEW/libmilter/README
--- sendmail-8.18.1/libmilter/README 2024-01-31 08:38:32.000000000 +0200
+++ sendmail-8.18.1-NEW/libmilter/README 2024-12-09 16:39:22.373049268 +0200
@@ -1,4 +1,8 @@
-This directory contains the source files for libmilter.
+This directory contanis the source files for building a static library
+(libmilter.a).
+
+A shared object libmilter (libmilter.so) can be built in the directory
+`libsharedmilter'.
The sendmail Mail Filter API (Milter) is designed to allow third-party
programs access to mail messages as they are being processed in order to
diff -Naru sendmail-8.18.1/libsharedmilter/Build sendmail-8.18.1-NEW/libsharedmilter/Build
--- sendmail-8.18.1/libsharedmilter/Build 1970-01-01 02:00:00.000000000 +0200
+++ sendmail-8.18.1-NEW/libsharedmilter/Build 2024-12-09 16:39:08.616149620 +0200
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Copyright (c) 1999-2000 Proofpoint, 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
+# the sendmail distribution.
+#
+#
+# $Id: Build,v 8.6 2013-11-22 20:51:36 ca Exp $
+
+exec ../devtools/bin/Build "$@"
diff -Naru sendmail-8.18.1/libsharedmilter/comm.c sendmail-8.18.1-NEW/libsharedmilter/comm.c
--- sendmail-8.18.1/libsharedmilter/comm.c 1970-01-01 02:00:00.000000000 +0200
+++ sendmail-8.18.1-NEW/libsharedmilter/comm.c 2024-12-09 16:39:08.616149620 +0200
@@ -0,0 +1,357 @@
+/*
+ * Copyright (c) 1999-2004, 2009 Proofpoint, 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
+ * the sendmail distribution.
+ *
+ */
+
+#include <sm/gen.h>
+SM_RCSID("@(#)$Id: comm.c,v 8.71 2013-11-22 20:51:36 ca Exp $")
+
+#include "libmilter.h"
+#include <sm/errstring.h>
+#include <sys/uio.h>
+
+static ssize_t retry_writev __P((socket_t, struct iovec *, int, struct timeval *));
+static size_t Maxdatasize = MILTER_MAX_DATA_SIZE;
+
+/*
+** SMFI_SETMAXDATASIZE -- set limit for milter data read/write.
+**
+** Parameters:
+** sz -- new limit.
+**
+** Returns:
+** old limit
+*/
+
+size_t
+smfi_setmaxdatasize(sz)
+ size_t sz;
+{
+ size_t old;
+
+ old = Maxdatasize;
+ Maxdatasize = sz;
+ return old;
+}
+
+/*
+** MI_RD_CMD -- read a command
+**
+** Parameters:
+** sd -- socket descriptor
+** timeout -- maximum time to wait
+** cmd -- single character command read from sd
+** rlen -- pointer to length of result
+** name -- name of milter
+**
+** Returns:
+** buffer with rest of command
+** (malloc()ed here, should be free()d)
+** hack: encode error in cmd
+*/
+
+char *
+mi_rd_cmd(sd, timeout, cmd, rlen, name)
+ socket_t sd;
+ struct timeval *timeout;
+ char *cmd;
+ size_t *rlen;
+ char *name;
+{
+ ssize_t len;
+ mi_int32 expl;
+ ssize_t i;
+ FD_RD_VAR(rds, excs);
+ int ret;
+ int save_errno;
+ char *buf;
+ char data[MILTER_LEN_BYTES + 1];
+
+ *cmd = '\0';
+ *rlen = 0;
+
+ i = 0;
+ for (;;)
+ {
+ FD_RD_INIT(sd, rds, excs);
+ ret = FD_RD_READY(sd, rds, excs, timeout);
+ if (ret == 0)
+ break;
+ else if (ret < 0)
+ {
+ if (errno == EINTR)
+ continue;
+ break;
+ }
+ if (FD_IS_RD_EXC(sd, rds, excs))
+ {
+ *cmd = SMFIC_SELECT;
+ return NULL;
+ }
+
+ len = MI_SOCK_READ(sd, data + i, sizeof data - i);
+ if (MI_SOCK_READ_FAIL(len))
+ {
+ smi_log(SMI_LOG_ERR,
+ "%s, mi_rd_cmd: read returned %d: %s",
+ name, (int) len, sm_errstring(errno));
+ *cmd = SMFIC_RECVERR;
+ return NULL;
+ }
+ if (len == 0)
+ {
+ *cmd = SMFIC_EOF;
+ return NULL;
+ }
+ if (len >= (ssize_t) sizeof data - i)
+ break;
+ i += len;
+ }
+ if (ret == 0)
+ {
+ *cmd = SMFIC_TIMEOUT;
+ return NULL;
+ }
+ else if (ret < 0)
+ {
+ smi_log(SMI_LOG_ERR,
+ "%s: mi_rd_cmd: %s() returned %d: %s",
+ name, MI_POLLSELECT, ret, sm_errstring(errno));
+ *cmd = SMFIC_RECVERR;
+ return NULL;
+ }
+
+ *cmd = data[MILTER_LEN_BYTES];
+ data[MILTER_LEN_BYTES] = '\0';
+ (void) memcpy((void *) &expl, (void *) &(data[0]), MILTER_LEN_BYTES);
+ expl = ntohl(expl) - 1;
+ if (expl <= 0)
+ return NULL;
+ if (expl > Maxdatasize)
+ {
+ *cmd = SMFIC_TOOBIG;
+ return NULL;
+ }
+#if _FFR_ADD_NULL
+ buf = malloc(expl + 1);
+#else
+ buf = malloc(expl);
+#endif
+ if (buf == NULL)
+ {
+ *cmd = SMFIC_MALLOC;
+ return NULL;
+ }
+
+ i = 0;
+ for (;;)
+ {
+ FD_RD_INIT(sd, rds, excs);
+ ret = FD_RD_READY(sd, rds, excs, timeout);
+ if (ret == 0)
+ break;
+ else if (ret < 0)
+ {
+ if (errno == EINTR)
+ continue;
+ break;
+ }
+ if (FD_IS_RD_EXC(sd, rds, excs))
+ {
+ *cmd = SMFIC_SELECT;
+ free(buf);
+ return NULL;
+ }
+ len = MI_SOCK_READ(sd, buf + i, expl - i);
+ if (MI_SOCK_READ_FAIL(len))
+ {
+ smi_log(SMI_LOG_ERR,
+ "%s: mi_rd_cmd: read returned %d: %s",
+ name, (int) len, sm_errstring(errno));
+ ret = -1;
+ break;
+ }
+ if (len == 0)
+ {
+ *cmd = SMFIC_EOF;
+ free(buf);
+ return NULL;
+ }
+ if (len > expl - i)
+ {
+ *cmd = SMFIC_RECVERR;
+ free(buf);
+ return NULL;
+ }
+ if (len >= expl - i)
+ {
+ *rlen = expl;
+#if _FFR_ADD_NULL
+ /* makes life simpler for common string routines */
+ buf[expl] = '\0';
+#endif
+ return buf;
+ }
+ i += len;
+ }
+
+ save_errno = errno;
+ free(buf);
+
+ /* select returned 0 (timeout) or < 0 (error) */
+ if (ret == 0)
+ {
+ *cmd = SMFIC_TIMEOUT;
+ return NULL;
+ }
+ if (ret < 0)
+ {
+ smi_log(SMI_LOG_ERR,
+ "%s: mi_rd_cmd: %s() returned %d: %s",
+ name, MI_POLLSELECT, ret, sm_errstring(save_errno));
+ *cmd = SMFIC_RECVERR;
+ return NULL;
+ }
+ *cmd = SMFIC_UNKNERR;
+ return NULL;
+}
+
+/*
+** RETRY_WRITEV -- Keep calling the writev() system call
+** until all the data is written out or an error occurs.
+**
+** Parameters:
+** fd -- socket descriptor
+** iov -- io vector
+** iovcnt -- number of elements in io vector
+** must NOT exceed UIO_MAXIOV.
+** timeout -- maximum time to wait
+**
+** Returns:
+** success: number of bytes written
+** otherwise: MI_FAILURE
+*/
+
+static ssize_t
+retry_writev(fd, iov, iovcnt, timeout)
+ socket_t fd;
+ struct iovec *iov;
+ int iovcnt;
+ struct timeval *timeout;
+{
+ int i;
+ ssize_t n, written;
+ FD_WR_VAR(wrs);
+
+ written = 0;
+ for (;;)
+ {
+ while (iovcnt > 0 && iov[0].iov_len == 0)
+ {
+ iov++;
+ iovcnt--;
+ }
+ if (iovcnt <= 0)
+ return written;
+
+ /*
+ ** We don't care much about the timeout here,
+ ** it's very long anyway; correct solution would be
+ ** to take the time before the loop and reduce the
+ ** timeout after each invocation.
+ ** FD_SETSIZE is checked when socket is created.
+ */
+
+ FD_WR_INIT(fd, wrs);
+ i = FD_WR_READY(fd, wrs, timeout);
+ if (i == 0)
+ return MI_FAILURE;
+ if (i < 0)
+ {
+ if (errno == EINTR || errno == EAGAIN)
+ continue;
+ return MI_FAILURE;
+ }
+ n = writev(fd, iov, iovcnt);
+ if (n == -1)
+ {
+ if (errno == EINTR || errno == EAGAIN)
+ continue;
+ return MI_FAILURE;
+ }
+
+ written += n;
+ for (i = 0; i < iovcnt; i++)
+ {
+ if (iov[i].iov_len > (unsigned int) n)
+ {
+ iov[i].iov_base = (char *)iov[i].iov_base + n;
+ iov[i].iov_len -= (unsigned int) n;
+ break;
+ }
+ n -= (int) iov[i].iov_len;
+ iov[i].iov_len = 0;
+ }
+ if (i == iovcnt)
+ return written;
+ }
+}
+
+/*
+** MI_WR_CMD -- write a cmd to sd
+**
+** Parameters:
+** sd -- socket descriptor
+** timeout -- maximum time to wait
+** cmd -- single character command to write
+** buf -- buffer with further data
+** len -- length of buffer (without cmd!)
+**
+** Returns:
+** MI_SUCCESS/MI_FAILURE
+*/
+
+int
+mi_wr_cmd(sd, timeout, cmd, buf, len)
+ socket_t sd;
+ struct timeval *timeout;
+ int cmd;
+ char *buf;
+ size_t len;
+{
+ size_t sl;
+ ssize_t l;
+ mi_int32 nl;
+ int iovcnt;
+ struct iovec iov[2];
+ char data[MILTER_LEN_BYTES + 1];
+
+ if (len > Maxdatasize || (len > 0 && buf == NULL))
+ return MI_FAILURE;
+
+ nl = htonl(len + 1); /* add 1 for the cmd char */
+ (void) memcpy(data, (void *) &nl, MILTER_LEN_BYTES);
+ data[MILTER_LEN_BYTES] = (char) cmd;
+ sl = MILTER_LEN_BYTES + 1;
+
+ /* set up the vector for the size / command */
+ iov[0].iov_base = (void *) data;
+ iov[0].iov_len = sl;
+ iovcnt = 1;
+ if (len >= 0 && buf != NULL)
+ {
+ iov[1].iov_base = (void *) buf;
+ iov[1].iov_len = len;
+ iovcnt = 2;
+ }
+
+ l = retry_writev(sd, iov, iovcnt, timeout);
+ if (l == MI_FAILURE)
+ return MI_FAILURE;
+ return MI_SUCCESS;
+}
diff -Naru sendmail-8.18.1/libsharedmilter/docs/api.html sendmail-8.18.1-NEW/libsharedmilter/docs/api.html
--- sendmail-8.18.1/libsharedmilter/docs/api.html 1970-01-01 02:00:00.000000000 +0200
+++ sendmail-8.18.1-NEW/libsharedmilter/docs/api.html 2024-12-09 16:39:08.616149620 +0200
@@ -0,0 +1,330 @@
+<HTML>
+<HEAD><TITLE>Milter API</TITLE></HEAD>
+<BODY>
+<!--
+$Id: api.html,v 1.39 2013-11-22 20:51:39 ca Exp $
+-->
+<H1>Milter API</H1>
+
+<H2>Contents</H2>
+<UL>
+ <LI><A HREF="#LibraryControlFunctions">Library Control Functions</A>
+ <LI><A HREF="#DataAccessFunctions">Data Access Functions</A>
+ <LI><A HREF="#MessageModificationFunctions">Message Modification Functions</A>
+ <LI><A HREF="#Callbacks">Callbacks</A>
+ <LI><A HREF="#Miscellaneous">Miscellaneous</A>
+</UL>
+
+<H2><A NAME="LibraryControlFunctions">Library Control Functions</A></H2>
+
+Before handing control to libmilter (by calling
+<A HREF="smfi_main.html">smfi_main</A>), a filter may call the following
+functions to set libmilter parameters.
+In particular, the filter must call
+<A HREF="smfi_register.html">smfi_register</A> to register its callbacks.
+Each function will return either MI_SUCCESS or MI_FAILURE to
+indicate the status of the operation.
+
+<P>
+None of these functions communicate with the MTA.
+All alter the library's state, some of which
+is communicated to the MTA inside
+<A HREF="smfi_main.html">smfi_main</A>.
+
+<P>
+<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=2><TR BGCOLOR="#dddddd"><TH>Function</TH><TH>Description</TH></TR>
+
+<TR><TD><A HREF="smfi_opensocket.html">smfi_opensocket</A></TD><TD>Try to create the interface socket.</TD></TR>
+
+<TR><TD><A HREF="smfi_register.html">smfi_register</A></TD><TD>Register a filter.</TD></TR>
+
+<TR><TD><A HREF="smfi_setconn.html">smfi_setconn</A></TD><TD>Specify socket to use.</TD></TR>
+
+<TR><TD><A HREF="smfi_settimeout.html">smfi_settimeout</A></TD><TD>Set timeout.</TD></TR>
+
+<TR><TD><A HREF="smfi_setbacklog.html">smfi_setbacklog</A></TD><TD>Define the incoming <CODE>listen(2)</CODE> queue size.</TD></TR>
+
+<TR><TD><A HREF="smfi_setdbg.html">smfi_setdbg</A></TD><TD>Set the milter library debugging (tracing) level.</TD></TR>
+
+<TR><TD><A HREF="smfi_stop.html">smfi_stop</A></TD><TD>Cause an orderly shutdown.</TD></TR>
+
+<TR><TD><A HREF="smfi_main.html">smfi_main</A></TD><TD>Hand control to libmilter.</TD></TR>
+
+</TABLE>
+
+<H2><A NAME="DataAccessFunctions">Data Access Functions</A></H2>
+
+The following functions may be called from within the filter-defined callbacks
+to access information about the current connection or message.
+<P>
+<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=2><TR bgcolor="#dddddd"><TH>Function</TH><TH>Description</TH></TR>
+<TR><TD><A HREF="smfi_getsymval.html">smfi_getsymval</A></TD><TD>Return the value
+of a symbol.</TD></TR>
+
+<TR><TD><A HREF="smfi_getpriv.html">smfi_getpriv</A></TD><TD>Get the private data
+pointer.</TD></TR>
+
+<TR><TD><A HREF="smfi_setpriv.html">smfi_setpriv</A></TD><TD>Set the private data
+pointer.</TD></TR>
+
+<TR><TD><A HREF="smfi_setreply.html">smfi_setreply</A></TD><TD>Set the specific
+reply code to be used.</TD></TR>
+
+<TR><TD><A HREF="smfi_setmlreply.html">smfi_setmlreply</A></TD><TD>Set the
+specific multi-line reply to be used.</TD></TR>
+
+</TABLE>
+
+<H2><A NAME="MessageModificationFunctions">Message Modification Functions</A></H2>
+
+The following functions change a message's contents and attributes.
+<EM>They may only be called in <A HREF="xxfi_eom.html">xxfi_eom</A></EM>.
+All of these functions may invoke additional communication with the MTA.
+They will return either MI_SUCCESS or MI_FAILURE to indicate the status of
+the operation.
+Message data (senders, recipients, headers, body chunks)
+passed to these functions via parameters is copied and does not need to be
+preserved (i.e., allocated memory can be freed).
+
+<P>
+A filter which might call a message modification function
+must set the appropriate flag
+(<A HREF="#SMFIF">listed below</A>),
+either
+in the description passed to <A HREF="smfi_register.html">smfi_register</A>
+or via <A HREF="xxfi_negotiate.html">xxfi_negotiate</A>.
+Failure to do so will cause the MTA to treat a call to the function
+as a failure of the filter, terminating its connection.
+
+<P>
+Note that the status returned indicates only whether or not the
+filter's message was successfully sent to the MTA, not whether or not
+the MTA performed the requested operation.
+For example,
+<A HREF="smfi_addheader.html">smfi_addheader</A>, when called with an
+illegal header name, will return MI_SUCCESS even though the MTA may
+later refuse to add the illegal header.
+<P>
+<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=2><TR BGCOLOR="#dddddd"><TH>Function</TH><TH>Description</TH><TH><A NAME="SMFIF">SMFIF_* flag</A></TH></TR>
+<TR><TD><A HREF="smfi_addheader.html">smfi_addheader</A></TD><TD>Add a header to
+the message.</TD><TD>SMFIF_ADDHDRS</TD></TR>
+
+<TR><TD><A HREF="smfi_chgheader.html">smfi_chgheader</A></TD><TD>Change or delete a header.</TD><TD>SMFIF_CHGHDRS</TD></TR>
+
+<TR><TD><A HREF="smfi_insheader.html">smfi_insheader</A></TD><TD>Insert a
+header into the message.</TD><TD>SMFIF_ADDHDRS</TD></TR>
+
+<TR><TD><A HREF="smfi_chgfrom.html">smfi_chgfrom</A></TD><TD>Change the
+envelope sender address.</TD><TD>SMFIF_CHGFROM</TD></TR>
+
+<TR><TD><A HREF="smfi_addrcpt.html">smfi_addrcpt</A></TD><TD>Add a recipient to
+the envelope.</TD><TD>SMFIF_ADDRCPT</TD></TR>
+
+<TR><TD><A HREF="smfi_addrcpt_par.html">smfi_addrcpt_par</A></TD><TD>Add
+a recipient including ESMTP parameter to the envelope.
+</TD><TD>SMFIF_ADDRCPT_PAR</TD></TR>
+
+<TR><TD><A HREF="smfi_delrcpt.html">smfi_delrcpt</A></TD><TD>Delete a recipient
+from the envelope.</TD><TD>SMFIF_DELRCPT</TD></TR>
+
+<TR><TD><A HREF="smfi_replacebody.html">smfi_replacebody</A></TD><TD>Replace the
+body of the message.</TD><TD>SMFIF_CHGBODY</TD></TR>
+
+</TABLE>
+
+<H2>Other Message Handling Functions</H2>
+
+The following functions provide special case handling instructions for
+milter or the MTA, without altering the content or status of the message.
+<EM>They too may only be called in <A HREF="xxfi_eom.html">xxfi_eom</A></EM>.
+All of these functions may invoke additional communication with the MTA.
+They will return either MI_SUCCESS or MI_FAILURE to indicate the status of
+the operation.
+
+<P>
+Note that the status returned indicates only whether or not the
+filter's message was successfully sent to the MTA, not whether or not
+the MTA performed the requested operation.
+
+<P>
+<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=2><TR BGCOLOR="#dddddd"><TH>Function</TH><TH>Description</TH></TR>
+<TR><TD><A HREF="smfi_progress.html">smfi_progress</A></TD><TD>Report operation in progress.</TD></TR>
+
+<TR><TD><A HREF="smfi_quarantine.html">smfi_quarantine</A></TD><TD>Quarantine a message.</TD></TR>
+
+</TABLE>
+
+<H2><A NAME="Callbacks">Callbacks</A></H2>
+
+The filter should implement one or more of the following callbacks,
+which are registered via <A HREF="smfi_register.html">smfi_register</A>:
+
+<P>
+<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=2><TR BGCOLOR="#dddddd"><TH>Function</TH><TH>Description</TH></TR>
+
+<TR><TD><A HREF="xxfi_connect.html">xxfi_connect</A></TD><TD>connection info</TD></TR>
+
+<TR><TD><A HREF="xxfi_helo.html">xxfi_helo</A></TD><TD>SMTP HELO/EHLO command</TD></TR>
+
+<TR><TD><A HREF="xxfi_envfrom.html">xxfi_envfrom</A></TD><TD>envelope sender</TD></TR>
+
+<TR><TD><A HREF="xxfi_envrcpt.html">xxfi_envrcpt</A></TD><TD>envelope recipient</TD></TR>
+
+<TR><TD><A HREF="xxfi_data.html">xxfi_data</A></TD><TD>DATA command</TD></TR>
+
+<TR><TD><A HREF="xxfi_unknown.html">xxfi_unknown</A></TD><TD>Unknown SMTP command</TD></TR>
+
+<TR><TD><A HREF="xxfi_header.html">xxfi_header</A></TD><TD>header</TD></TR>
+
+<TR><TD><A HREF="xxfi_eoh.html">xxfi_eoh</A></TD><TD>end of header</TD></TR>
+
+<TR><TD><A HREF="xxfi_body.html">xxfi_body</A></TD><TD>body block</TD></TR>
+
+<TR><TD><A HREF="xxfi_eom.html">xxfi_eom</A></TD><TD>end of message</TD></TR>
+
+<TR><TD><A HREF="xxfi_abort.html">xxfi_abort</A></TD><TD>message aborted</TD></TR>
+
+<TR><TD><A HREF="xxfi_close.html">xxfi_close</A></TD><TD>connection cleanup</TD></TR>
+
+<TR><TD><A HREF="xxfi_negotiate.html">xxfi_negotiate</A></TD><TD>option negotiation</TD></TR>
+
+</TABLE>
+
+<P>
+The above callbacks should all return one of the following return values,
+having the indicated meanings.
+Any return other than one of the below values constitutes an error,
+and will cause sendmail to terminate its connection to the offending filter.
+
+<P><A NAME="conn-spec">Milter</A> distinguishes between recipient-,
+message-, and connection-oriented routines.
+Recipient-oriented callbacks may affect the processing
+of a single message recipient;
+message-oriented callbacks, a single message;
+connection-oriented callbacks, an entire connection
+(during which multiple messages may be delivered
+to multiple sets of recipients).
+<A HREF="xxfi_envrcpt.html">xxfi_envrcpt</A> is recipient-oriented.
+<A HREF="xxfi_negotiate.html">xxfi_negotiate</A>,
+<A HREF="xxfi_connect.html">xxfi_connect</A>,
+<A HREF="xxfi_helo.html">xxfi_helo</A> and
+<A HREF="xxfi_close.html">xxfi_close</A> are connection-oriented.
+All other callbacks are message-oriented.
+
+<P>
+<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=2>
+ <TR BGCOLOR="#dddddd"><TH>Return value</TH><TH>Description</TH></TR>
+ <TR VALIGN="TOP">
+ <TD>SMFIS_CONTINUE</TD>
+ <TD>Continue processing the current connection, message, or recipient.
+ </TD>
+ </TR>
+ <TR VALIGN="TOP">
+ <TD>SMFIS_REJECT</TD>
+ <TD>For a connection-oriented routine, reject this connection; call <A HREF="xxfi_close.html">xxfi_close</A>.<BR>
+ For a message-oriented routine (except
+ <A HREF="xxfi_abort.html">xxfi_abort</A>), reject this message.<BR>
+ For a recipient-oriented routine, reject the current recipient (but continue processing the current message).
+ </TD>
+ </TR>
+ <TR valign="top">
+ <TD>SMFIS_DISCARD</TD>
+ <TD>For a message- or recipient-oriented routine, accept this message, but silently discard it.<BR>
+ SMFIS_DISCARD should not be returned by a connection-oriented routine.
+ </TD>
+ </TR>
+ <TR valign="top">
+ <TD>SMFIS_ACCEPT</TD>
+ <TD>For a connection-oriented routine, accept this connection without further filter processing; call <A HREF="xxfi_close.html">xxfi_close</A>.<BR>
+ For a message- or recipient-oriented routine, accept this message without further filtering.<BR>
+ </TD>
+ </TR>
+ <TR valign="top">
+ <TD>SMFIS_TEMPFAIL</TD>
+ <TD>Return a temporary failure, i.e., the corresponding SMTP command will return an appropriate 4xx status code.
+ For a message-oriented routine (except <A HREF="xxfi_envfrom.html">xxfi_envfrom</A>), fail for this message.<BR>
+ For a connection-oriented routine, fail for this connection; call <A HREF="xxfi_close.html">xxfi_close</A>.<BR>
+ For a recipient-oriented routine, only fail for the current recipient; continue message processing.
+ </TD>
+ </TR>
+
+ <TR valign="top">
+ <TD><A NAME="SMFIS_SKIP">SMFIS_SKIP</A></TD>
+ <TD>Skip further callbacks of the same type in this transaction.
+ Currently this return value is only allowed in
+ <A HREF="xxfi_body.html">xxfi_body()</A>.
+ It can be used if a milter has received sufficiently many
+ body chunks to make a decision, but still wants to invoke
+ message modification functions that are only allowed to be called from
+ <A HREF="xxfi_eom.html">xxfi_eom()</A>.
+ Note: the milter <EM>must</EM>
+ <A HREF="xxfi_negotiate.html">negotiate</A>
+ this behavior with the MTA, i.e., it must check whether
+ the protocol action
+ <A HREF="xxfi_negotiate.html#SMFIP_SKIP"><CODE>SMFIP_SKIP</CODE></A>
+ is available and if so, the milter must request it.
+ </TD>
+ </TR>
+
+ <TR valign="top">
+ <TD><A NAME="SMFIS_NOREPLY">SMFIS_NOREPLY</A></TD>
+ <TD>Do not send a reply back to the MTA.
+ The milter <EM>must</EM>
+ <A HREF="xxfi_negotiate.html">negotiate</A>
+ this behavior with the MTA, i.e., it must check whether
+ the appropriate protocol action
+ <A HREF="xxfi_negotiate.html#SMFIP_NR_"><CODE>SMFIP_NR_*</CODE></A>
+ is available and if so, the milter must request it.
+ If you set the
+ <A HREF="xxfi_negotiate.html#SMFIP_NR_"><CODE>SMFIP_NR_*</CODE></A>
+ protocol action for a callback, that callback <EM>must</EM>
+ always reply with
+ SMFIS_NOREPLY.
+ Using any other reply code is a violation of the API.
+ If in some cases your callback may return another value
+ (e.g., due to some resource shortages), then you
+ <EM>must not</EM> set
+ <A HREF="xxfi_negotiate.html#SMFIP_NR_"><CODE>SMFIP_NR_*</CODE></A>
+ and you must use
+ SMFIS_CONTINUE as the default return code.
+ (Alternatively you can try to delay reporting the problem to
+ a later callback for which
+ <A HREF="xxfi_negotiate.html#SMFIP_NR_"><CODE>SMFIP_NR_*</CODE></A>
+ is not set.)
+ </TD>
+ </TR>
+
+</TABLE>
+
+<H2><A NAME="Miscellaneous">Miscellaneous</A></H2>
+
+<P>
+<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=2><TR BGCOLOR="#dddddd"><TH>Function</TH><TH>Description</TH></TR>
+
+<TR><TD><A HREF="smfi_version.html">smfi_version</A></TD><TD>libmilter (runtime) version info</TD></TR>
+
+<TR><TD><A HREF="smfi_setsymlist.html">smfi_setsymlist</A></TD><TD>
+Set the list of macros that the milter wants to receive from the MTA
+for a protocol stage.
+</TD></TR>
+
+</TABLE>
+
+<P>
+<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=2><TR BGCOLOR="#dddddd"><TH>Constant</TH><TH>Description</TH></TR>
+
+<TR><TD><A HREF="smfi_version.html">SMFI_VERSION</A></TD><TD>libmilter (compile time) version info</TD></TR>
+
+</TABLE>
+
+
+<HR SIZE="1">
+<FONT SIZE="-1">
+Copyright (c) 2000, 2003, 2006, 2009 Proofpoint, Inc. and its suppliers.
+All rights reserved.
+<BR>
+By using this file, you agree to the terms and conditions set
+forth in the LICENSE.
+</FONT>
+</BODY>
+</HTML>
diff -Naru sendmail-8.18.1/libsharedmilter/docs/design.html sendmail-8.18.1-NEW/libsharedmilter/docs/design.html
--- sendmail-8.18.1/libsharedmilter/docs/design.html 1970-01-01 02:00:00.000000000 +0200
+++ sendmail-8.18.1-NEW/libsharedmilter/docs/design.html 2024-12-09 16:39:08.616149620 +0200
@@ -0,0 +1,151 @@
+<HTML>
+<HEAD>
+<TITLE>Architecture</TITLE>
+</HEAD>
+<BODY>
+<!--
+$Id: design.html,v 1.13 2013-11-22 20:51:39 ca Exp $
+-->
+
+<H1>Architecture</H1>
+
+<H2>Contents</H2>
+
+<UL>
+ <LI>Design Goals
+ <LI>Implementing Filtering Policies
+ <LI>MTA - Filter Communication
+</UL>
+
+<H2>Goals</H2>
+
+The Sendmail Content Management API (Milter) provides an interface for
+third-party software to validate and modify messages as they pass
+through the mail transport system. Filters can process messages'
+connection (IP) information, envelope protocol elements, message
+headers, and/or message body contents, and modify a message's
+recipients, headers, and body. The MTA configuration file specifies
+which filters are to be applied, and in what order, allowing an
+administrator to combine multiple independently-developed filters.
+
+<P>
+We expect to see both vendor-supplied, configurable mail filtering
+applications and a multiplicity of script-like filters designed by and
+for MTA administrators.
+A certain degree of coding sophistication and
+domain knowledge on the part of the filter provider is assumed.
+This allows filters to exercise fine-grained control at the SMTP level.
+However, as will be seen in the example, many filtering applications
+can be written with relatively little protocol knowledge,
+but a basic understanding (e.g., as documented in RFC 5321:
+<EM>The dialog is purposely lock-step, one-at-a-time</EM>)
+is necessary.
+
+<P>
+Given these expectations, the API is designed to achieve the following
+goals:
+
+<OL>
+ <LI>Safety/security.
+ Filter processes should not need to run as root
+ (of course, they can if required, but that is a local issue);
+ this will simplify coding
+ and limit the impact of security flaws in the filter program.
+<P>
+ <LI>Reliability.
+ Coding failures in a Milter process that cause that process
+ to hang or core-dump
+ should not stop mail delivery.
+ Faced with such a failure,
+ sendmail should use a default mechanism,
+ either behaving as if the filter were not present
+ or as if a required resource were unavailable.
+ The latter failure mode will generally have sendmail return
+ a 4xx SMTP code (although in later phases of the SMTP protocol
+ it may cause the mail to be queued for later processing).
+<P>
+ <LI>Simplicity.
+ The API should make implementation of a new filter
+ no more difficult than absolutely necessary.
+ Subgoals include:
+ <UL>
+ <LI>Encourage good thread practice
+ by defining thread-clean interfaces including local data hooks.
+ <LI>Provide all interfaces required
+ while avoiding unnecessary pedanticism.
+ </UL>
+<P>
+ <LI>Performance.
+ Simple filters should not seriously impact overall MTA performance.
+</OL>
+
+<H2>Implementing Filtering Policies</H2>
+
+Milter is designed to allow a server administrator to combine
+third-party filters to implement a desired mail filtering policy. For
+example, if a site wished to scan incoming mail for viruses on several
+platforms, eliminate unsolicited commercial email, and append a mandated
+footer to selected incoming messages, the administrator could configure
+the MTA to filter messages first through a server based anti-virus
+engine, then via a large-scale spam-catching service, and finally
+append the desired footer if the message still met requisite criteria.
+Any of these filters could be added or changed independently.
+
+<P>
+Thus the site administrator, not the filter writer, controls the
+overall mail filtering environment. In particular, he/she must decide
+which filters are run, in what order they are run, and how they
+communicate with the MTA. These parameters, as well as the
+actions to be taken if a filter becomes unavailable, are selectable
+during MTA configuration. <A href="installation.html">Further
+details</A> are available later in this document.
+
+<H2>MTA - Filter communication</H2>
+
+Filters run as separate processes, outside of the sendmail address
+space. The benefits of this are threefold:
+
+<OL>
+ <LI>The filter need not run with "root" permissions, thereby
+ avoiding a large family of potential security problems.</LI>
+
+ <LI>Failures in a particular filter will not affect the MTA or
+ other filters.</LI>
+
+ <LI>The filter can potentially have higher performance because of
+ the parallelism inherent in multiple processes.</LI>
+</OL>
+
+<P>
+Each filter may communicate with multiple MTAs at the same time over
+local or remote connections, using multiple threads of execution.
+<A HREF="#figure-1">Figure 1</A> illustrates a possible network of
+communication channels between a site's filters, its MTAs, and other
+MTAs on the network:
+</P>
+<DIV align="center">
+<A name="figure-1"><IMG src="figure1.jpg" ALT=""></A><BR>
+<B>Figure 1: A set of MTA's interacting with a set of filters.</B>
+</DIV>
+<P>
+The Milter library (libmilter) implements the communication protocol.
+It accepts connections from various MTAs, passes the relevant data to
+the filter through callbacks, then makes appropriate responses based
+on return codes. A filter may also send data to the MTA as a result
+of library calls. <A href="#figure-2">Figure 2</A> shows a single
+filter process processing messages from two MTAs:
+</P>
+<DIV align="center">
+<IMG src="figure2.jpg" ALT=""><BR>
+<B>Figure 2: A filter handling simultaneous requests from two MTA's.</B>
+</DIV>
+<HR size="1">
+<FONT size="-1">
+Copyright (c) 2000, 2003 Proofpoint, Inc. and its suppliers.
+All rights reserved.
+<BR>
+By using this file, you agree to the terms and conditions set
+forth in the LICENSE.
+</FONT>
+</BODY>
+</HTML>
diff -Naru sendmail-8.18.1/libsharedmilter/docs/figure1.fig sendmail-8.18.1-NEW/libsharedmilter/docs/figure1.fig
--- sendmail-8.18.1/libsharedmilter/docs/figure1.fig 1970-01-01 02:00:00.000000000 +0200
+++ sendmail-8.18.1-NEW/libsharedmilter/docs/figure1.fig 2024-12-09 16:39:08.616149620 +0200
@@ -0,0 +1,56 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter
+100.00
+Single
+-2
+1200 2
+6 975 225 5025 3375
+6 1500 1275 2700 2025
+2 2 0 2 1 7 50 0 -1 0.000 0 0 7 0 0 5
+ 1650 1425 2550 1425 2550 1875 1650 1875 1650 1425
+4 0 1 50 0 0 20 0.0000 4 195 645 1800 1725 MTA\001
+-6
+6 1950 2625 3150 3375
+2 2 0 2 4 7 50 0 -1 0.000 0 0 7 0 0 5
+ 2100 2775 3000 2775 3000 3225 2100 3225 2100 2775
+4 0 4 50 0 0 20 0.0000 4 195 645 2250 3075 MTA\001
+-6
+6 1050 225 2250 975
+2 2 0 2 14 7 50 0 -1 0.000 0 0 7 0 0 5
+ 1200 375 2100 375 2100 825 1200 825 1200 375
+4 0 14 50 0 0 20 0.0000 4 195 645 1350 675 MTA\001
+-6
+2 1 0 2 1 7 50 0 -1 0.000 0 0 7 0 0 2
+ 2550 1575 3750 2625
+2 1 0 2 1 7 50 0 -1 0.000 0 0 7 0 0 2
+ 2550 1575 3750 1575
+2 1 0 2 1 7 50 0 -1 0.000 0 0 7 0 0 2
+ 2550 1575 3750 825
+2 1 0 2 4 7 50 0 -1 0.000 0 0 7 0 0 2
+ 3000 2925 3750 2625
+2 1 0 2 14 7 50 0 -1 0.000 0 0 7 0 0 2
+ 2100 525 3750 825
+2 1 0 2 14 7 50 0 -1 0.000 0 0 7 0 0 2
+ 2100 525 3750 2625
+2 1 0 4 0 7 50 0 -1 0.000 0 0 7 0 0 2
+ 1050 3075 2100 3075
+2 1 0 4 0 7 50 0 -1 0.000 0 0 7 0 0 2
+ 1050 1725 1650 1725
+2 1 0 4 0 7 50 0 -1 0.000 0 0 7 0 0 2
+ 1050 675 1200 675
+2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
+ 3750 2475 4950 2475 4950 2925 3750 2925 3750 2475
+2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
+ 3750 1425 4950 1425 4950 1875 3750 1875 3750 1425
+2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
+ 3750 525 4950 525 4950 975 3750 975 3750 525
+4 0 0 50 0 1 20 0.0000 4 210 795 3900 2775 Filter 3\001
+4 0 0 50 0 1 20 0.0000 4 210 795 3900 1725 Filter 2\001
+4 0 0 50 0 1 20 0.0000 4 210 795 3900 825 Filter 1\001
+-6
+2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
+ 300 525 1050 525 1050 3225 300 3225 300 525
+4 0 0 50 0 2 24 1.5708 4 255 1950 825 2850 INTERNET\001
diff -Naru sendmail-8.18.1/libsharedmilter/docs/figure1.jpg sendmail-8.18.1-NEW/libsharedmilter/docs/figure1.jpg
--- sendmail-8.18.1/libsharedmilter/docs/figure1.jpg 1970-01-01 02:00:00.000000000 +0200
+++ sendmail-8.18.1-NEW/libsharedmilter/docs/figure1.jpg 2024-12-09 16:39:08.616149620 +0200
@@ -0,0 +1,136 @@
+ÿØÿà JFIF ÿþ ¦Image generated by Aladdin Ghostscript (device=ppmraw)
+
+CREATOR: XV Version 3.10a Rev: 12/29/94 (jp-extension 5.3.3 + PNG patch 1.2d) Quality = 95, Smoothing = 30
+ÿÛ C
+
+
+
+
+
+
+
+
+ÿÛ C
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ÿÀ ¾-"
|