improve named part/attachment detection

will now detect filenames for parts if the part specifies Content-Disposition without a filename parameter and Content-Type with a name parameter
pull/232/head
ashiire 1 year ago committed by GitHub
parent cccf01cb9a
commit da49ac5b1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -158,11 +158,11 @@ mime_filename(struct message *msg)
static char buf[512];
char *v;
char *filename = 0;
if ((v = blaze822_hdr(msg, "content-disposition"))) {
if (blaze822_mime2231_parameter(v, "filename",
buf, sizeof buf, "UTF-8"))
filename = buf;
if ((v = blaze822_hdr(msg, "content-disposition")) &&
blaze822_mime2231_parameter(v, "filename",
buf, sizeof buf, "UTF-8")) {
filename = buf;
} else if ((v = blaze822_hdr(msg, "content-type"))) {
if (blaze822_mime2231_parameter(v, "name",
buf, sizeof buf, "UTF-8"))

Loading…
Cancel
Save