Skip to content

Submitting a .eml/.msg File as Attachment #14

@soulsf

Description

@soulsf

I'd like to submit an eml/msg File as attachment. After adding "message/rfc822" to the .conf "files:" section, I get an error when submitting an email with an attached .eml:

===
[INFO]: Found attachment: Mail-Anhang.eml (message/rfc822)
Traceback (most recent call last):
File "/home/so/dockers/imap2thehive/imap2thehive.py", line 252, in submitTheHive
tmp.write(part.get_payload(decode=1))
TypeError: a bytes-like object is required, not 'NoneType'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/so/dockers/imap2thehive/imap2thehive.py", line 548, in
main()
File "/home/so/dockers/imap2thehive/imap2thehive.py", line 544, in main
readMail(mailConnect())
File "/home/so/dockers/imap2thehive/imap2thehive.py", line 417, in readMail
if submitTheHive(message) == True:
File "/home/so/dockers/imap2thehive/imap2thehive.py", line 254, in submitTheHive
except OSerror as e:
NameError: name 'OSerror' is not defined

Seems like it's the same as described here:

https://www.reddit.com/r/learnpython/comments/80c3bt/extract_email_attachment_when_attachment_is_an/

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