--- mm2.7/src/src/metamail/metamail.c.orig 2006-03-20 14:07:16.689062000 +0100 +++ mm2.7/src/src/metamail/metamail.c 2006-03-21 14:18:29.529062000 +0100 @@ -66,6 +66,7 @@ int RunAsRootOK = 0; char *ContentType = NULL, + *ContentDisposition = NULL, *ContentEncoding = NULL, *MailerName = "unknown", *MailSubject = "Mail message", @@ -157,6 +158,7 @@ ContentType = NULL; ContentEncoding = NULL; + ContentDisposition = NULL, MailSubject = "Mail message"; MailFrom = "unknown sender"; MailSummary = "non-text mail message"; @@ -386,6 +388,7 @@ Fname[0] = 0; suggestedname = FindParam("name"); + if (!suggestedname) suggestedname = FindParam("filename"); if (!suggestedname) { MkTmpFileName(SugBuf); suggestedname = SugBuf; @@ -577,7 +580,7 @@ /* strip leading white space */ while (*ContentType && isspace((unsigned char) *ContentType)) ++ContentType; StripTrailingSpace(ContentType); - ParseContentParameters(ContentType); + ParseContentParameters(0, ContentType); break; case 'd': MightAskBeforeExecuting = 0; @@ -1240,6 +1243,7 @@ BoundaryCt=0; return -1; } + ContentDisposition = NULL; for (s=mailheaders+oldbytes; *s; ++s) { if (*s == '\n' && (*(s+1) != ' ') && (*(s+1) != '\t')) { if (!ContentType && !lc2strncmp(s, "\ncontent-type:", 14)) { @@ -1262,7 +1266,7 @@ } } StripTrailingSpace(ContentType); - ParseContentParameters(ContentType); + ParseContentParameters(0, ContentType); if (PrintHeads) maybephead(s+1); } else if (!ContentEncoding && !lc2strncmp(s, "\ncontent-transfer-encoding:", 27)) { ContentEncoding = FreshHeaderCopy(s+27); @@ -1273,9 +1277,13 @@ } else if (!lc2strncmp(s, "\nfrom:", 6)) { if (PrintHeads) maybephead(s+1); MailFrom = FreshHeaderCopy(s+6); - } else if (!lc2strncmp(s, "\ncontent-description:", 4)) { + } else if (!lc2strncmp(s, "\ncontent-description:", 21)) { if(PrintHeads) maybephead(s+1); MailSubject = FreshHeaderCopy(s+21); + } else if (!ContentDisposition && !lc2strncmp(s, "\ncontent-disposition:", 21)) { + ContentDisposition = FreshHeaderCopy(s+21); + StripTrailingSpace(ContentDisposition); + ParseContentParameters(CParamsUsed, ContentDisposition); } else { /* Print any with encoded variables */ char *dum = s; @@ -2114,12 +2122,13 @@ } void -ParseContentParameters(ct) +ParseContentParameters(pc, ct) +int pc; char *ct; { char *s, *t, *eq; - CParamsUsed = 0; + CParamsUsed = pc; s = index(ct, ';'); if (!s) return; *s++ = 0;