- if ((cp = get_param(ct->c_dispo_first, "filename", '_', 0))
- && decode_rfc2047(cp, storefile, PATH_MAX+1)
- && *storefile != '/'
- && *storefile != '.'
- && *storefile != '|'
- && *storefile != '!'
- && !strchr (storefile, '%')) {
- ct->c_storeproc = add (storefile, NULL);
+ if ((cp = get_param(ct->c_dispo_first, "filename", '_', 0)) &&
+ use_param_as_filename(cp)) {
+ ct->c_storeproc = mh_xstrdup(cp);