Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/gnu/dist/sendmail Pull up revisions 1.7-1.8 (requested ...



details:   https://anonhg.NetBSD.org/src/rev/449c491294dc
branches:  netbsd-1-5
changeset: 492793:449c491294dc
user:      he <he%NetBSD.org@localhost>
date:      Wed Feb 20 23:12:25 2002 +0000

description:
Pull up revisions 1.7-1.8 (requested by itojun):
  Upgrade to sendmail version 8.11.6.

diffstat:

 gnu/dist/sendmail/libmilter/README     |   31 ++-
 gnu/dist/sendmail/sendmail/collect.c   |   59 ++++++--
 gnu/dist/sendmail/sendmail/parseaddr.c |   13 +-
 gnu/dist/sendmail/sendmail/queue.c     |  196 ++++++++++++++++++++++------
 gnu/dist/sendmail/sendmail/srvrsmtp.c  |  102 ++++++++++----
 gnu/dist/sendmail/sendmail/usersmtp.c  |   98 +++++++------
 gnu/dist/sendmail/sendmail/util.c      |  224 +++++++++++++++++++++++++++++++-
 7 files changed, 555 insertions(+), 168 deletions(-)

diffs (truncated from 1592 to 300 lines):

diff -r d4853dab97c1 -r 449c491294dc gnu/dist/sendmail/libmilter/README
--- a/gnu/dist/sendmail/libmilter/README        Wed Feb 20 23:12:21 2002 +0000
+++ b/gnu/dist/sendmail/libmilter/README        Wed Feb 20 23:12:25 2002 +0000
@@ -10,7 +10,7 @@
 issuing the './Build' command in SRCDIR/libmilter .
 
 NOTE: Both libmilter and the callouts in sendmail are marked as an FFR (For
-Future Release).  If you intend to use them in 8.10.X, you must compiled
+Future Release).  If you intend to use them in 8.11.X, you must compiled
 both libmilter and sendmail with -D_FFR_MILTER defined.  You can do this by
 adding the following to your devtools/Site/site.config.m4 file:
 
@@ -59,14 +59,14 @@
 For example:
 
        Xfilter1, S=local:/var/run/f1.sock, F=R
-       Xfilter2, S=inet6:999@localhost, F=T, T=S:1s;R:1s;E:5m
+       Xfilter2, S=inet6:999@localhost, F=T, T=C:10m;S:1s;R:1s;E:5m
        Xfilter3, S=inet:3333@localhost
 
 specifies three filters.  Filters can be specified in your .mc file using
 the following:
 
        INPUT_MAIL_FILTER(`filter1', `S=local:/var/run/f1.sock, F=R')
-       INPUT_MAIL_FILTER(`filter2', `S=inet6:999@localhost, F=T, T=S:1s;R:1s;E:5m')
+       INPUT_MAIL_FILTER(`filter2', `S=inet6:999@localhost, F=T, T=C:10m;S:1s;R:1s;E:5m')
        INPUT_MAIL_FILTER(`filter3', `S=inet:3333@localhost')
 
 The first attaches to a Unix-domain socket in the /var/run directory; the
@@ -80,24 +80,27 @@
 as if the filter were not present.
 
 Finally, you can override the default timeouts used by sendmail when
-talking to the filters using the T= equate.  There are three fields inside
+talking to the filters using the T= equate.  There are four fields inside
 of the T= equate:
 
 Letter          Meaning
-  S             Timeout for sending information from the MTA to a filter
-  R             Timeout for reading reply from the filter
-  E             Overall timeout between sending end-of-message to filter
-                and waiting for the final acknowledgment
+  C            Timeout for connecting to a filter (if 0, use system timeout)
+  S            Timeout for sending information from the MTA to a filter
+  R            Timeout for reading reply from the filter
+  E            Overall timeout between sending end-of-message to filter
+               and waiting for the final acknowledgment
 
 Note the separator between each is a ';' as a ',' already separates equates
-and therefore can't separate timeouts.  The default values (if not set in the config) are:
+and therefore can't separate timeouts.  The default values (if not set in
+the config) are:
 
-T=S:10s;R:10s;E:5m
+T=C:0m;S:10s;R:10s;E:5m
 
 where 's' is seconds and 'm' is minutes.
 
 Which filters are invoked and their sequencing is handled by the 
-InputMailFilters option.
+InputMailFilters option. Note: if InputMailFilters is not defined no filters
+will be used.
 
        O InputMailFilters=filter1, filter2, filter3
 
@@ -223,7 +226,7 @@
        char **envfrom;
 {
        struct mlfiPriv *priv;
-       int fd;
+       int fd = -1;
 
        /* allocate some private memory */
        priv = malloc(sizeof *priv);
@@ -244,6 +247,8 @@
        if ((fd = mkstemp(priv->mlfi_fname)) < 0 ||
            (priv->mlfi_fp = fdopen(fd, "w+")) == NULL)
        {
+               if (fd >= 0)
+                       (void) close(fd);
                free(priv->mlfi_fname);
                free(priv);
                return SMFIS_TEMPFAIL;
@@ -421,4 +426,4 @@
 
 /* eof */
 
-Revision: 8.9.2.1.2.14, Last updated Date: 2001/02/21 23:08:19
+Revision: 8.9.2.1.2.19, Last updated Date: 2001/06/28 22:25:14
diff -r d4853dab97c1 -r 449c491294dc gnu/dist/sendmail/sendmail/collect.c
--- a/gnu/dist/sendmail/sendmail/collect.c      Wed Feb 20 23:12:21 2002 +0000
+++ b/gnu/dist/sendmail/sendmail/collect.c      Wed Feb 20 23:12:25 2002 +0000
@@ -12,7 +12,7 @@
  */
 
 #ifndef lint
-static char id[] = "@(#)Id: collect.c,v 8.136.4.15 2001/02/21 01:05:59 gshapiro Exp";
+static char id[] = "@(#)Id: collect.c,v 8.136.4.22 2001/06/07 21:01:02 ca Exp";
 #endif /* ! lint */
 
 #include <sendmail.h>
@@ -47,8 +47,8 @@
 */
 
 static jmp_buf CtxCollectTimeout;
-static bool    CollectProgress;
-static EVENT   *CollectTimeout;
+static bool    volatile CollectProgress;
+static EVENT   *volatile CollectTimeout = NULL;
 
 /* values for input state machine */
 #define IS_NORM                0       /* middle of line */
@@ -212,10 +212,12 @@
                                if (TrafficLogFile != NULL && !headeronly)
                                {
                                        if (istate == IS_BOL)
-                                               (void) fprintf(TrafficLogFile, "%05d <<< ",
-                                                       (int) getpid());
+                                               (void) fprintf(TrafficLogFile,
+                                                              "%05d <<< ",
+                                                              (int) getpid());
                                        if (c == EOF)
-                                               (void) fprintf(TrafficLogFile, "[EOF]\n");
+                                               (void) fprintf(TrafficLogFile,
+                                                              "[EOF]\n");
                                        else
                                                (void) putc(c, TrafficLogFile);
                                }
@@ -312,7 +314,6 @@
                                /* just put the character out */
                                if (!bitset(EF_TOOBIG, e->e_flags))
                                        (void) putc(c, df);
-
                                /* FALLTHROUGH */
 
                          case MS_DISCARD:
@@ -337,7 +338,7 @@
                                memmove(buf, obuf, bp - obuf);
                                bp = &buf[bp - obuf];
                                if (obuf != bufbuf)
-                                       free(obuf);
+                                       sm_free(obuf);
                        }
                        if (c >= 0200 && c <= 0237)
                        {
@@ -351,7 +352,8 @@
                        {
                                *bp++ = c;
                                hdrslen++;
-                               if (MaxHeadersLength > 0 &&
+                               if (!headeronly &&
+                                   MaxHeadersLength > 0 &&
                                    hdrslen > MaxHeadersLength)
                                {
                                        sm_syslog(LOG_NOTICE, e->e_id,
@@ -479,7 +481,8 @@
        }
 
        /* reset global timer */
-       clrevent(CollectTimeout);
+       if (CollectTimeout != NULL)
+               clrevent(CollectTimeout);
 
        if (headeronly)
                return;
@@ -721,15 +724,37 @@
 collecttimeout(timeout)
        time_t timeout;
 {
-       /* if no progress was made, die now */
-       if (!CollectProgress)
-               longjmp(CtxCollectTimeout, 1);
+       int save_errno = errno;
+
+       /*
+       **  NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER.  DO NOT ADD
+       **      ANYTHING TO THIS ROUTINE UNLESS YOU KNOW WHAT YOU ARE
+       **      DOING.
+       */
 
-       /* otherwise reset the timeout */
-       CollectTimeout = setevent(timeout, collecttimeout, timeout);
-       CollectProgress = FALSE;
+       if (CollectProgress)
+       {
+               /* reset the timeout */
+               CollectTimeout = sigsafe_setevent(timeout, collecttimeout,
+                                                 timeout);
+               CollectProgress = FALSE;
+       }
+       else
+       {
+               /* event is done */
+               CollectTimeout = NULL;
+       }
+
+       /* if no progress was made or problem resetting event, die now */
+       if (CollectTimeout == NULL)
+       {
+               errno = ETIMEDOUT;
+               longjmp(CtxCollectTimeout, 1);
+       }
+
+       errno = save_errno;
 }
-/*
+/*
 **  DFERROR -- signal error on writing the data file.
 **
 **     Parameters:
diff -r d4853dab97c1 -r 449c491294dc gnu/dist/sendmail/sendmail/parseaddr.c
--- a/gnu/dist/sendmail/sendmail/parseaddr.c    Wed Feb 20 23:12:21 2002 +0000
+++ b/gnu/dist/sendmail/sendmail/parseaddr.c    Wed Feb 20 23:12:25 2002 +0000
@@ -12,7 +12,7 @@
  */
 
 #ifndef lint
-static char id[] = "@(#)Id: parseaddr.c,v 8.234.4.11 2001/02/14 04:07:27 gshapiro Exp";
+static char id[] = "@(#)Id: parseaddr.c,v 8.234.4.13 2001/08/14 23:08:13 ca Exp";
 #endif /* ! lint */
 
 #include <sendmail.h>
@@ -767,9 +767,6 @@
        char    **match_pattern;        /* pointer to pattern */
 };
 
-#define MAXMATCH       9       /* max params per rewrite */
-
-
 int
 rewrite(pvp, ruleset, reclevel, e)
        char **pvp;
@@ -1157,7 +1154,7 @@
                                        if ((size_t) trsize > pvpb1_size)
                                        {
                                                if (pvpb1 != NULL)
-                                                       free(pvpb1);
+                                                       sm_free(pvpb1);
                                                pvpb1 = (char **)xalloc(trsize);
                                                pvpb1_size = trsize;
                                        }
@@ -1583,7 +1580,7 @@
                if (i > rwbuflen)
                {
                        if (rwbuf != NULL)
-                               free(rwbuf);
+                               sm_free(rwbuf);
                        rwbuflen = i;
                        rwbuf = (char *) xalloc(rwbuflen);
                }
@@ -2461,7 +2458,7 @@
                if (tTd(29, 9))
                        dprintf("maplocaluser: address unchanged\n");
                if (a1 != NULL)
-                       free(a1);
+                       sm_free(a1);
                return;
        }
 
@@ -2808,7 +2805,7 @@
        QuickAbort = saveQuickAbort;
        setstat(rstat);
        if (buf != buf0)
-               free(buf);
+               sm_free(buf);
 
        if (rstat != EX_OK && QuickAbort)
                longjmp(TopFrame, 2);
diff -r d4853dab97c1 -r 449c491294dc gnu/dist/sendmail/sendmail/queue.c
--- a/gnu/dist/sendmail/sendmail/queue.c        Wed Feb 20 23:12:21 2002 +0000
+++ b/gnu/dist/sendmail/sendmail/queue.c        Wed Feb 20 23:12:25 2002 +0000
@@ -16,9 +16,9 @@
 
 #ifndef lint
 # if QUEUE
-static char id[] = "@(#)Id: queue.c,v 8.343.4.44 2001/02/22 00:55:35 ca Exp (with queueing)";
+static char id[] = "@(#)Id: queue.c,v 8.343.4.62 2001/07/20 00:53:01 gshapiro Exp (with queueing)";
 # else /* QUEUE */
-static char id[] = "@(#)Id: queue.c,v 8.343.4.44 2001/02/22 00:55:35 ca Exp (without queueing)";
+static char id[] = "@(#)Id: queue.c,v 8.343.4.62 2001/07/20 00:53:01 gshapiro Exp (without queueing)";
 # endif /* QUEUE */
 #endif /* ! lint */
 
@@ -68,6 +68,35 @@
 static int     workcmpf3();
 static int     workcmpf4();
 
+/*
+**  Current qf file field assignments:
+**
+**     A       AUTH= parameter
+**     B       body type
+**     C       controlling user
+**     D       data file name
+**     E       error recipient
+**     F       flag bits
+**     G       queue delay algorithm
+**     H       header
+**     I       data file's inode number
+**     K       time of last delivery attempt



Home | Main Index | Thread Index | Old Index