and more fixes

pull/4/head
Sascha Rommelfangen 2017-06-02 07:32:51 +02:00
parent 83b695fe73
commit ee4be71e19
1 changed files with 5 additions and 3 deletions

View File

@ -63,7 +63,7 @@ else:
mailcontent = sys.argv[1]
syslog.syslog(mailcontent)
if len(sys.argv) >= 3:
mail_subject = sys.argv[2]
mail_subject = sys.argv[2].encode("utf-8", "ignore")
email_data = b''
msg = email.message_from_string(mailcontent)
if not mail_subject:
@ -83,8 +83,10 @@ for part in msg.walk():
part.set_charset(charset)
syslog.syslog(str(part.get_payload(decode=True)))
email_data += part.get_payload(decode=True)
print("here")
email_subject += mail_subject
try:
email_subject += mail_subject
except Exception as e:
syslog.syslog(str(e))
stdin_used = True
#except Exception as e:
# if debug: