pull/4/head
Sascha Rommelfangen 2017-06-01 17:00:32 +02:00
parent 0138b2fecf
commit 3de6a6a5aa
2 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
@ -60,7 +60,7 @@ try:
else: else:
mailcontent = sys.argv[1] mailcontent = sys.argv[1]
if len(sys.argv) >= 3: if len(sys.argv) >= 3:
email_subject = sys.argv[2] mail_subject = sys.argv[2]
email_data = b'' email_data = b''
syslog.syslog(mailcontent) syslog.syslog(mailcontent)
msg = email.message_from_string(mailcontent) msg = email.message_from_string(mailcontent)
@ -76,11 +76,13 @@ try:
if part.get_content_maintype() == 'text': if part.get_content_maintype() == 'text':
part.set_charset(charset) part.set_charset(charset)
email_data += part.get_payload(decode=True) email_data += part.get_payload(decode=True)
print("here")
email_subject += mail_subject email_subject += mail_subject
stdin_used = True stdin_used = True
except Exception as e: except Exception as e:
if debug: if debug:
syslog.syslog("FATAL ERROR: Not all required input received") syslog.syslog("FATAL ERROR: Not all required input received")
print(str(e))
syslog.syslog(str(e)) syslog.syslog(str(e))
sys.exit(1) sys.exit(1)

View File

@ -1,4 +1,4 @@
#!/usr/bin/python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys import sys
import os import os