struct part **pp;
CT ct;
FILE *in;
+ HF hp;
umask(~m_gmprot());
switch (state = m_getfld(state, name, buf, sizeof(buf), in)) {
case FLD:
case FLDPLUS:
- case FLDEOF:
compnum++;
/* abort if draft has Mime-Version header field */
while (state == FLDPLUS)
state = m_getfld(state, name, buf,
sizeof(buf), in);
- goto finish_field;
+ continue;
}
/* get copies of the buffers */
/* Now add the header data to the list */
add_header(ct, np, vp);
-finish_field:
- /* if this wasn't the last hdr field, then continue */
- if (state != FLDEOF)
- continue;
- /* else fall... */
+ continue;
case FILEEOF:
adios(EX_CONFIG, NULL, "draft has empty body -- no directives!");
/* NOTREACHED */
case BODY:
- case BODYEOF:
fseek(in, (long) (-strlen(buf)), SEEK_CUR);
break;
}
/*
+ ** 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, NULL)) {
+ adios(EX_DATAERR, NULL, "Unable to encode header \"%s\"", hp->name);
+ }
+ }
+
+ /*
** Now add the MIME-Version header field
** to the list of header fields.
*/
if (ct->c_descr) {
np = getcpy(DESCR_FIELD);
vp = concat(" ", ct->c_descr, NULL);
+ if (encode_rfc2047(DESCR_FIELD, &vp, NULL)) {
+ adios(EX_DATAERR, NULL, "Unable to encode %s header", DESCR_FIELD);
+ }
add_header(ct, np, vp);
}