- char *cp = strchr (ct->c_dispo, ';');
- CI ci = calloc (1, sizeof *ci);
- int status;
- int found_filename = 0;
-
- if (cp && parse_header_attrs (ct->c_file, strlen (invo_name) + 2, &cp,
- ci, &status) == OK) {
- for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) {
- if (! strcasecmp (*ap, "filename")
- && *(cp = *ep) != '/'
- && *cp != '.'
- && *cp != '|'
- && *cp != '!'
- && !strchr (cp, '%')) {
- ct->c_storeproc = add (cp, NULL);
- found_filename = 1;
- }
- free (*ap);
- }
+ if ((cp = get_param(ct->c_dispo_first, "filename", '_', 0)) &&
+ use_param_as_filename(cp)) {
+ ct->c_storeproc = mh_xstrdup(cp);
+ free(cp);
+ return;