fake_smtp integration modified (-r) for larger files

pull/4/head
CIRCL 2017-06-02 11:13:48 +02:00
parent 98d0145af3
commit a59863ced9
1 changed files with 12 additions and 4 deletions

View File

@ -59,6 +59,14 @@ mail_subject = ""
#if not sys.stdin.isatty():
if len(sys.argv) == 1:
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:
mailcontent = sys.argv[1]
syslog.syslog(mailcontent)