]> diplodocus.org Git - nmh/blobdiff - uip/mhbuildsbr.c
Switch to the (correct) casting of char to unsigned char for is*() macros.
[nmh] / uip / mhbuildsbr.c
index 07358cd356b0c6a69119a718253e6207d7d25751..79268399261973f681cb570a485d77c94244078d 100644 (file)
@@ -19,7 +19,6 @@
 #include <fcntl.h>
 #include <h/signals.h>
 #include <h/md5.h>
-#include <signal.h>
 #include <h/mts.h>
 #include <h/tws.h>
 #include <h/mime.h>
@@ -138,6 +137,7 @@ build_mime (char *infile, int directives)
     struct part **pp;
     CT ct;
     FILE *in;
+    HF hp;
     m_getfld_state_t gstate = 0;
 
     directive_init(directives);
@@ -228,6 +228,17 @@ finish_field:
     }
     m_getfld_state_destroy (&gstate);
 
+    /*
+     * Iterate through the list of headers and call the function to MIME-ify
+     * them if required.
+     */
+
+    for (hp = ct->c_first_hf; hp != NULL; hp = hp->next) {
+       if (encode_rfc2047(hp->name, &hp->value, CE_UNKNOWN, NULL)) {
+           adios(NULL, "Unable to encode header \"%s\"", hp->name);
+       }
+    }
+
     /*
      * Now add the MIME-Version header field
      * to the list of header fields.