Skip to content

Issue with attachments - TypeError: expected str, bytes or os.PathLike object, not list #26

Description

@glwallum

Hello,

I am experiencing an issue with the attachment import feature. Output of imap2thehive.py is below. It looks like thehive4py is looking for a different object type for the attachment file. Any ideas?

[WARNING]: Both case template and tasks are defined. Template (thehive_template) will be used.
[INFO]: Processing REDACTEDEMAIL
[INFO]: Connected to IMAP server.
[INFO]: 1 unread messages to process
[INFO]: From: REDACTEDEMAIL Subject: er
[INFO]: Found attachment: file.docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document)
[DEBUG]: Searching for \S*(ALERT|VTMIS)\S* in 'er'
[INFO]: Created case 38
Traceback (most recent call last):
File "./imap2thehive.py", line 557, in
main()
File "./imap2thehive.py", line 553, in main
readMail(mailConnect())
File "./imap2thehive.py", line 426, in readMail
if submitTheHive(message) == True:
File "./imap2thehive.py", line 365, in submitTheHive
message = 'Found as email attachment'
File "/usr/local/lib/python3.6/site-packages/thehive4py/models.py", line 591, in init
file_object = open(filename, 'rb')
TypeError: expected str, bytes or os.PathLike object, not list

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions