output headers with commas into the queue
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 22 Sep 1982 01:10:45 +0000 (17:10 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 22 Sep 1982 01:10:45 +0000 (17:10 -0800)
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 3.115
SCCS-vsn: usr.sbin/sendmail/src/queue.c 3.43

usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/queue.c

index 6035683..112cfd8 100644 (file)
@@ -3,7 +3,7 @@
 # include "sendmail.h"
 # include <sys/stat.h>
 
 # include "sendmail.h"
 # include <sys/stat.h>
 
-SCCSID(@(#)deliver.c   3.114           %G%);
+SCCSID(@(#)deliver.c   3.115           %G%);
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
@@ -1009,7 +1009,8 @@ putheader(fp, m, e)
 **             p -- the value to put in it.
 **             fp -- file to put it to.
 **             oldstyle -- TRUE if this is an old style header.
 **             p -- the value to put in it.
 **             fp -- file to put it to.
 **             oldstyle -- TRUE if this is an old style header.
-**             m -- a pointer to the mailer descriptor.
+**             m -- a pointer to the mailer descriptor.  If NULL,
+**                     don't transform the name at all.
 **
 **     Returns:
 **             none.
 **
 **     Returns:
 **             none.
@@ -1027,7 +1028,7 @@ commaize(h, p, fp, oldstyle, m)
 {
        register char *obp;
        int opos;
 {
        register char *obp;
        int opos;
-       bool fullsmtp = bitset(M_FULLSMTP, m->m_flags);
+       bool fullsmtp = FALSE;
        bool firstone = TRUE;
        char obuf[MAXLINE];
 
        bool firstone = TRUE;
        char obuf[MAXLINE];
 
@@ -1041,6 +1042,9 @@ commaize(h, p, fp, oldstyle, m)
                printf("commaize(%s: %s)\n", h->h_field, p);
 # endif DEBUG
 
                printf("commaize(%s: %s)\n", h->h_field, p);
 # endif DEBUG
 
+       if (m != NULL && bitset(M_FULLSMTP, m->m_flags))
+               fullsmtp = TRUE;
+
        obp = obuf;
        (void) sprintf(obp, "%s: ", capitalize(h->h_field));
        opos = strlen(h->h_field) + 2;
        obp = obuf;
        (void) sprintf(obp, "%s: ", capitalize(h->h_field));
        opos = strlen(h->h_field) + 2;
@@ -1102,7 +1106,8 @@ commaize(h, p, fp, oldstyle, m)
                *p = '\0';
 
                /* translate the name to be relative */
                *p = '\0';
 
                /* translate the name to be relative */
-               name = remotename(name, m, bitset(H_FROM, h->h_flags));
+               if (m != NULL)
+                       name = remotename(name, m, bitset(H_FROM, h->h_flags));
                if (*name == '\0')
                {
                        *p = savechar;
                if (*name == '\0')
                {
                        *p = savechar;
index ec56d61..a758a29 100644 (file)
@@ -5,10 +5,10 @@
 # include <errno.h>
 
 # ifndef QUEUE
 # include <errno.h>
 
 # ifndef QUEUE
-SCCSID(@(#)queue.c     3.42            %G%     (no queueing));
+SCCSID(@(#)queue.c     3.43            %G%     (no queueing));
 # else QUEUE
 
 # else QUEUE
 
-SCCSID(@(#)queue.c     3.42            %G%);
+SCCSID(@(#)queue.c     3.43            %G%);
 
 /*
 **  QUEUEUP -- queue a message up for future transmission.
 
 /*
 **  QUEUEUP -- queue a message up for future transmission.
@@ -134,14 +134,13 @@ queueup(e, queueall)
                fprintf(tfp, "H");
                if (h->h_mflags != 0 && bitset(H_CHECK|H_ACHECK, h->h_flags))
                        mfdecode(h->h_mflags, tfp);
                fprintf(tfp, "H");
                if (h->h_mflags != 0 && bitset(H_CHECK|H_ACHECK, h->h_flags))
                        mfdecode(h->h_mflags, tfp);
-               fprintf(tfp, "%s: ", h->h_field);
                if (bitset(H_DEFAULT, h->h_flags))
                {
                        (void) expand(h->h_value, buf, &buf[sizeof buf], e);
                if (bitset(H_DEFAULT, h->h_flags))
                {
                        (void) expand(h->h_value, buf, &buf[sizeof buf], e);
-                       fprintf(tfp, "%s\n", buf);
+                       fprintf(tfp, "%s: %s\n", h->h_field, buf);
                }
                else
                }
                else
-                       fprintf(tfp, "%s\n", h->h_value);
+                       commaize(h, h->h_value, tfp, e->e_oldstyle, NULL);
        }
 
        /*
        }
 
        /*