mirror of https://github.com/MISP/mail_to_misp
and more fixes
parent
83b695fe73
commit
ee4be71e19
|
@ -63,7 +63,7 @@ else:
|
||||||
mailcontent = sys.argv[1]
|
mailcontent = sys.argv[1]
|
||||||
syslog.syslog(mailcontent)
|
syslog.syslog(mailcontent)
|
||||||
if len(sys.argv) >= 3:
|
if len(sys.argv) >= 3:
|
||||||
mail_subject = sys.argv[2]
|
mail_subject = sys.argv[2].encode("utf-8", "ignore")
|
||||||
email_data = b''
|
email_data = b''
|
||||||
msg = email.message_from_string(mailcontent)
|
msg = email.message_from_string(mailcontent)
|
||||||
if not mail_subject:
|
if not mail_subject:
|
||||||
|
@ -83,8 +83,10 @@ for part in msg.walk():
|
||||||
part.set_charset(charset)
|
part.set_charset(charset)
|
||||||
syslog.syslog(str(part.get_payload(decode=True)))
|
syslog.syslog(str(part.get_payload(decode=True)))
|
||||||
email_data += part.get_payload(decode=True)
|
email_data += part.get_payload(decode=True)
|
||||||
print("here")
|
try:
|
||||||
email_subject += mail_subject
|
email_subject += mail_subject
|
||||||
|
except Exception as e:
|
||||||
|
syslog.syslog(str(e))
|
||||||
stdin_used = True
|
stdin_used = True
|
||||||
#except Exception as e:
|
#except Exception as e:
|
||||||
# if debug:
|
# if debug:
|
||||||
|
|
Loading…
Reference in New Issue