-/*
- * mhfixmsg.c -- rewrite a message with various transformations
+/* mhfixmsg.c -- rewrite a message with various transformations
*
* This code is Copyright (c) 2002 and 2013, by the authors of nmh.
* See the COPYRIGHT file in the root directory of the nmh
set_text_ctparams(ct, fx.decodetypes, fx.lf_line_endings);
*ctp++ = ct;
} else {
- advise (NULL, "unable to parse message from file %s", file);
+ inform("unable to parse message from file %s", file);
status = NOTOK;
/* If there's an outfile, pass the input message unchanged, so the
}
if (copy_input_to_output (file, infp, outfile, outfp) != OK) {
- advise (NULL, "unable to copy message to %s, "
+ inform("unable to copy message to %s, "
"it might be lost\n", outfile);
}
set_text_ctparams(ct, fx.decodetypes, fx.lf_line_endings);
*ctp++ = ct;
} else {
- advise (NULL, "unable to parse message %s", msgnam);
+ inform("unable to parse message %s", msgnam);
status = NOTOK;
/* If there's an outfile, pass the input message
if (copy_input_to_output (input_filename, infp,
outfile, outfp) != OK) {
- advise (NULL,
- "unable to copy message to %s, "
- "it might be lost\n",
- outfile);
+ inform("unable to copy message to %s, "
+ "it might be lost\n", outfile);
}
fclose (infp);
to the output. */
if (copy_input_to_output (input_filename, *infp, outfile,
*outfp) != OK) {
- advise (NULL, "unable to copy message to %s, it might be lost\n",
+ inform("unable to copy message to %s, it might be lost\n",
outfile);
}
}
}
} else {
*ct = NULL;
- advise (NULL, "unable to parse fixed part");
+ inform("unable to parse fixed part");
status = NOTOK;
}
free (filename);
} else {
- advise (NULL, "unable to replace broken boundary");
+ inform("unable to replace broken boundary");
status = NOTOK;
}
} else {
- advise (NULL, "unable to create temporary file in %s",
+ inform("unable to create temporary file in %s",
get_temp_dir());
status = NOTOK;
}
int status = OK;
if (ct->c_file == NULL) {
- advise (NULL, "missing input filename");
+ inform("missing input filename");
return NOTOK;
}
case LENERR:
case FMTERR:
- advise (NULL, "message format error in component #%d", compnum);
+ inform("message format error in component #%d", compnum);
status = NOTOK;
break;
default:
- advise (NULL, "getfld() returned %d", state);
+ inform("getfld() returned %d", state);
status = NOTOK;
break;
}
*cp = '\0';
ct_subtype = mh_xstrdup(++cp);
} else {
- advise (NULL, "missing / in MIME type of %s %s",
+ inform("missing / in MIME type of %s %s",
ct->c_file, ct->c_partno);
free (ct_type);
return NOTOK;
ct->c_ctinfo.ci_subtype = ct_subtype;
if (! replace_substring (&ct->c_ctline, type,
ct_type_subtype)) {
- advise (NULL, "did not find %s in %s",
+ inform("did not find %s in %s",
type, ct->c_ctline);
}
}
break;
} else {
- advise (NULL, "did not find %s in %s",
+ inform("did not find %s in %s",
type, hf->value);
}
}
parent->c_ctinfo.ci_subtype = mh_xstrdup("alternative");
if (! replace_substring (&parent->c_ctline, "/related",
"/alternative")) {
- advise (NULL,
- "did not find multipart/related in %s",
- parent->c_ctline);
+ inform("did not find multipart/related in %s",
+ parent->c_ctline);
}
/* Update Content-Type header field. */
remove_parameter (hf->value, "type");
break;
} else {
- advise (NULL, "did not find multipart/"
+ inform("did not find multipart/"
"related in header %s",
hf->value);
}
/* This m_mktemp2() call closes the temp file. */
if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, NULL)) == NULL) {
- advise (NULL, "unable to create temporary file in %s",
+ inform("unable to create temporary file in %s",
get_temp_dir());
} else {
tmp_plain_file = mh_xstrdup (tempfile);
(void) m_unlink (tmp_decoded);
free (tmp_decoded);
if (fclose (file)) {
- admonish (NULL, "unable to close temporary file %s", tempfile);
+ inform("unable to close temporary file %s, continuing...", tempfile);
}
return status;
/* Check for invo_name-format-type/subtype. */
if ((cf = context_find_by_type ("format", type, subtype)) == NULL) {
if (verbosw) {
- advise (NULL, "Don't know how to convert %s, there is no "
+ inform("Don't know how to convert %s, there is no "
"%s-format-%s/%s profile entry",
ct->c_file, invo_name, type, subtype);
}
return NOTOK;
}
if (strchr (cf, '>')) {
- advise (NULL, "'>' prohibited in \"%s\",\nplease fix your "
+ inform("'>' prohibited in \"%s\",\nplease fix your "
"%s-format-%s/%s profile entry", cf, invo_name, type,
subtype ? subtype : "");
}
if (found_boundary) {
- advise (NULL, "giving up trying to find a unique boundary");
+ inform("giving up trying to find a unique boundary");
free_content (ct);
return NULL;
}
}
if (close (fd)) {
- admonish (NULL, "unable to write temporary file %s",
+ inform("unable to write temporary file %s, continuing...",
stripped_content_file);
(void) m_unlink (stripped_content_file);
status = NOTOK;
replace_param (first_pm, last_pm, name, decoded, 0);
fixed = 1;
} else {
- advise (NULL, "failed to decode %s parameter %s", name, value);
+ inform("failed to decode %s parameter %s", name, value);
}
}
free((void *)new_params); /* Cast away const. Sigh. */
free((void *)params);
} else {
- advise (NULL, "did not find semicolon in %s:%s\n",
+ inform("did not find semicolon in %s:%s\n",
hf->name, hf->value);
}
}
expand filename to absolute path. */
int file = ct->c_file && ct->c_file[0] == '/';
- admonish (NULL, "unable to rename %s %s to %s",
+ inform("unable to rename %s %s to %s, continuing...",
file ? "file" : "message", outfile,
infile);
status = NOTOK;
}
}
} else {
- admonish (NULL, "unable to remove input file %s, "
- "not modifying it", infile);
+ inform("unable to remove input file %s, "
+ "not modifying it, continuing...", infile);
(void) m_unlink (outfile);
status = NOTOK;
}