]> diplodocus.org Git - nmh/blobdiff - uip/post.c
Started revising m_getfld() code to replace direct buffer
[nmh] / uip / post.c
index ff7519760541f6f5e03962ff420597cc22eee9cb..c81f0fcc0af4b6b89adb6245c65cbed05f7b1647 100644 (file)
@@ -558,7 +558,7 @@ main (int argc, char **argv)
     start_headers ();
     if (debug) {
        verbose++;
-       discard (out = stdout); /* XXX: reference discard() to help loader */
+       out = stdout;
     } else {
        if (whomsw) {
            if ((out = fopen ("/dev/null", "w")) == NULL)
@@ -579,14 +579,16 @@ main (int argc, char **argv)
     hdrtab = msgstate == NORMAL ? NHeaders : RHeaders;
 
     for (compnum = 1, state = FLD;;) {
-       switch (state = m_getfld (state, name, buf, sizeof(buf), in)) {
+       int bufsz = sizeof buf;
+       switch (state = m_getfld (state, name, buf, &bufsz, in)) {
            case FLD: 
            case FLDEOF: 
            case FLDPLUS: 
                compnum++;
                cp = add (buf, NULL);
                while (state == FLDPLUS) {
-                   state = m_getfld (state, name, buf, sizeof(buf), in);
+                   bufsz = sizeof buf;
+                   state = m_getfld (state, name, buf, &bufsz, in);
                    cp = add (buf, cp);
                }
                putfmt (name, cp, out);
@@ -603,7 +605,8 @@ main (int argc, char **argv)
                    break;
                fprintf (out, "\n%s", buf);
                while (state == BODY) {
-                   state = m_getfld (state, name, buf, sizeof(buf), in);
+                   bufsz = sizeof buf;
+                   state = m_getfld (state, name, buf, &bufsz, in);
                    fputs (buf, out);
                }
                break;
@@ -854,8 +857,22 @@ putfmt (char *name, char *str, FILE *out)
                else
                    if (mp->m_gname)
                        putgrp (namep, mp->m_gname, out, hdr->flags);
-               if (mp->m_ingrp)
+               if (mp->m_ingrp) {
+                   if (sm_mts == MTS_SENDMAIL_PIPE) {
+                       /* Catch this before sendmail chokes with:
+                          "553 List:; syntax illegal for recipient
+                           addresses".
+                          If we wanted to, we could expand out blind
+                          aliases and put them in Bcc:, but then
+                          they'd have the Blind-Carbon-Copy
+                          indication. */
+                       adios (NULL,
+                              "blind lists not compatible with"
+                              " sendmail/pipe");
+                   }
+
                    grp++;
+               }
                if (putadr (namep, qp, mp, out, hdr->flags))
                    msgflags |= (hdr->set & (MVIS | MINV));
                else