put return-receipt-to on a conf.c flag (but don't set it);
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 31 Dec 1992 03:00:58 +0000 (19:00 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 31 Dec 1992 03:00:58 +0000 (19:00 -0800)
fix minor syslog problem

SCCS-vsn: usr.sbin/sendmail/src/headers.c 6.2
SCCS-vsn: usr.sbin/sendmail/src/version.c 6.2
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 6.2
SCCS-vsn: usr.sbin/sendmail/src/conf.c 6.2

usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/headers.c
usr/src/usr.sbin/sendmail/src/sendmail.h
usr/src/usr.sbin/sendmail/src/version.c

index 66a7e1b..7c122b3 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)conf.c     6.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c     6.2 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <sys/ioctl.h>
 #endif /* not lint */
 
 # include <sys/ioctl.h>
@@ -59,8 +59,8 @@ struct hdrinfo        HdrInfo[] =
        "from",                 H_FROM,
        "reply-to",             H_FROM,
        "full-name",            H_ACHECK,
        "from",                 H_FROM,
        "reply-to",             H_FROM,
        "full-name",            H_ACHECK,
-       "return-receipt-to",    H_FROM,
-       "errors-to",            H_FROM,
+       "return-receipt-to",    H_FROM /* |H_RECEIPTTO */,
+       "errors-to",            H_FROM|H_ERRORSTO,
                /* destination fields */
        "to",                   H_RCPT,
        "resent-to",            H_RCPT|H_RESENT,
                /* destination fields */
        "to",                   H_RCPT,
        "resent-to",            H_RCPT|H_RESENT,
index a2bd414..3e5b649 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)headers.c  6.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)headers.c  6.2 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <errno.h>
 #endif /* not lint */
 
 # include <errno.h>
@@ -302,6 +302,7 @@ eatheader(e)
 
                if (tTd(32, 1))
                        printf("%s: %s\n", capitalize(h->h_field), h->h_value);
 
                if (tTd(32, 1))
                        printf("%s: %s\n", capitalize(h->h_field), h->h_value);
+
                /* count the number of times it has been processed */
                if (bitset(H_TRACE, h->h_flags))
                        hopcnt++;
                /* count the number of times it has been processed */
                if (bitset(H_TRACE, h->h_flags))
                        hopcnt++;
@@ -327,6 +328,14 @@ eatheader(e)
                                msgid = msgidbuf;
                        }
                }
                                msgid = msgidbuf;
                        }
                }
+
+               /* see if this is a return-receipt header */
+               if (bitset(H_RECEIPTTO, h->h_flags))
+                       e->e_receiptto = h->h_value;
+
+               /* see if this is an errors-to header */
+               if (bitset(H_ERRORSTO, h->h_flags))
+                       sendtolist(h->h_value, (ADDRESS *) NULL, &e->e_errorqueue, e);
        }
        if (tTd(32, 1))
                printf("----------------------------\n");
        }
        if (tTd(32, 1))
                printf("----------------------------\n");
@@ -344,16 +353,6 @@ eatheader(e)
                                 - e->e_class * WkClassFact
                                 + e->e_nrcpts * WkRecipFact;
 
                                 - e->e_class * WkClassFact
                                 + e->e_nrcpts * WkRecipFact;
 
-       /* return receipt to */
-       p = hvalue("return-receipt-to", e);
-       if (p != NULL)
-               e->e_receiptto = p;
-
-       /* errors to */
-       p = hvalue("errors-to", e);
-       if (p != NULL)
-               sendtolist(p, (ADDRESS *) NULL, &e->e_errorqueue, e);
-
        /* full name of from person */
        p = hvalue("full-name", e);
        if (p != NULL)
        /* full name of from person */
        p = hvalue("full-name", e);
        if (p != NULL)
@@ -378,21 +377,28 @@ eatheader(e)
 # ifdef LOG
        if (!QueueRun && LogLevel > 1)
        {
 # ifdef LOG
        if (!QueueRun && LogLevel > 1)
        {
+               char *name;
                char hbuf[MAXNAME];
                char hbuf[MAXNAME];
-               char *name = hbuf;
-               extern char *inet_ntoa();
+               char sbuf[MAXLINE];
 
                if (RealHostName == NULL)
                        name = "local";
                else if (RealHostName[0] == '[')
                        name = RealHostName;
                else
 
                if (RealHostName == NULL)
                        name = "local";
                else if (RealHostName[0] == '[')
                        name = RealHostName;
                else
+               {
+                       extern char *inet_ntoa();
+
+                       name = hbuf;
                        (void)sprintf(hbuf, "%.80s (%s)", 
                            RealHostName, inet_ntoa(RealHostAddr.sin_addr));
                        (void)sprintf(hbuf, "%.80s (%s)", 
                            RealHostName, inet_ntoa(RealHostAddr.sin_addr));
-               syslog(LOG_INFO,
-                   "%s: from=%s, size=%ld, class=%d, msgid=%s, received from %s\n",
-                   e->e_id, e->e_from.q_paddr, e->e_msgsize,
-                   e->e_class, msgid, name);
+               }
+
+               /* some versions of syslog only take 5 printf args */
+               sprintf(sbuf, "from=%.200s, size=%ld, class=%d, msgid=%.100s",
+                   e->e_from.q_paddr, e->e_msgsize, e->e_class, msgid);
+               syslog(LOG_INFO, "%s: %s, received from %s\n",
+                   e->e_id, sbuf, name);
        }
 # endif /* LOG */
 }
        }
 # endif /* LOG */
 }
index 25ed021..4093eda 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)sendmail.h  6.1 (Berkeley) %G%
+ *     @(#)sendmail.h  6.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -15,7 +15,7 @@
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 6.1             %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 6.2             %G%";
 # endif lint
 # else /*  _DEFINE */
 # define EXTERN extern
 # endif lint
 # else /*  _DEFINE */
 # define EXTERN extern
@@ -215,6 +215,8 @@ extern struct hdrinfo       HdrInfo[];
 # define H_TRACE       00200   /* this field contains trace information */
 # define H_FROM                00400   /* this is a from-type field */
 # define H_VALID       01000   /* this field has a validated value */
 # define H_TRACE       00200   /* this field contains trace information */
 # define H_FROM                00400   /* this is a from-type field */
 # define H_VALID       01000   /* this field has a validated value */
+# define H_RECEIPTTO   02000   /* this field has return receipt info */
+# define H_ERRORSTO    04000   /* this field has error address info */
 \f/*
 **  Envelope structure.
 **     This structure defines the message itself.  There is usually
 \f/*
 **  Envelope structure.
 **     This structure defines the message itself.  There is usually
index 345b7ea..be29012 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)version.c  6.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c  6.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
-char   Version[] = "ALPHA-6.1";
+char   Version[] = "ALPHA-6.2";