mirror of https://github.com/MISP/mail_to_misp
fake_smtp integration modified (-r) for larger files
parent
98d0145af3
commit
a59863ced9
|
@ -59,6 +59,14 @@ mail_subject = ""
|
||||||
#if not sys.stdin.isatty():
|
#if not sys.stdin.isatty():
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
mailcontent = sys.stdin.buffer.read().decode("utf-8", "ignore")
|
mailcontent = sys.stdin.buffer.read().decode("utf-8", "ignore")
|
||||||
|
else:
|
||||||
|
# read from tempfile
|
||||||
|
if sys.argv[1] == "-r":
|
||||||
|
tempfilename = sys.argv[2]
|
||||||
|
tf = open(tempfilename, 'r')
|
||||||
|
mailcontent = tf.read()
|
||||||
|
tf.close()
|
||||||
|
# receive data and subject through arguments
|
||||||
else:
|
else:
|
||||||
mailcontent = sys.argv[1]
|
mailcontent = sys.argv[1]
|
||||||
syslog.syslog(mailcontent)
|
syslog.syslog(mailcontent)
|
||||||
|
|
Loading…
Reference in New Issue