memcpy (&cd->filename, &found->value, sizeof (cd->filename));
}
}
-
}
else {
for (i = 0; i < hdrs->len; i ++) {
if (cd) {
msg_debug_mime ("processed content disposition: %s",
cd->lc_data);
+
+ /* We still need to check filename */
+ if (cd->filename.len == 0) {
+ if (part->ct && part->ct->attrs) {
+ RSPAMD_FTOK_ASSIGN (&srch, "name");
+ found = g_hash_table_lookup (part->ct->attrs, &srch);
+
+ if (!found) {
+ RSPAMD_FTOK_ASSIGN (&srch, "filename");
+ found = g_hash_table_lookup (part->ct->attrs, &srch);
+ }
+
+ if (found) {
+ cd->type = RSPAMD_CT_ATTACHMENT;
+ memcpy (&cd->filename, &found->value,
+ sizeof (cd->filename));
+ }
+ }
+ }
break;
}
}