X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/55f65ae2d3baf60396d3359db952460939de03ca..2e1fefc99cc267b1eba7484f740d8bee7c2f59fb:/uip/mhbuildsbr.c diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 8d3a76df..e4499170 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -69,11 +69,6 @@ int find_cache (CT, int, int *, char *, char *, int); void free_ctinfo (CT); void free_encoding (CT, int); -/* - * prototypes - */ -CT build_mime (char *, int); - /* * static prototypes */ @@ -128,7 +123,7 @@ static void directive_pop(void) */ CT -build_mime (char *infile, int directives) +build_mime (char *infile, int directives, int header_encoding) { int compnum, state; char buf[BUFSIZ], name[NAMESZ]; @@ -137,6 +132,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); @@ -227,6 +223,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, header_encoding, NULL)) { + adios(NULL, "Unable to encode header \"%s\"", hp->name); + } + } + /* * Now add the MIME-Version header field * to the list of header fields.