Merge pull request #951 from passiv/master

Prevent filename collisions when processing attachments
This commit is contained in:
Garret Wassermann 2021-03-08 13:10:00 -05:00 committed by GitHub
commit 0bdaa87a58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -551,6 +551,8 @@ def object_from_message(message, queue, logger):
if not name:
ext = mimetypes.guess_extension(part.get_content_type())
name = "part-%i%s" % (counter, ext)
else:
name = ("part-%i_" % counter) + name
# FIXME: this code gets the paylods, then does something with it and then completely ignores it
# writing the part.get_payload(decode=True) instead; and then the payload variable is