# HG changeset patch # User Alex Zeffertt # Date 1270723905 -3600 # Node ID 0dbc5306a0ddb1c65de472a524594d9b8a48d558 # Parent a182192d6af59e2f05bae57d02c63ab42cba6639 CA-39663: Make mail-alarm handle unicode characters in email Signed-off-by: Alex Zeffertt diff -r a182192d6af5 -r 0dbc5306a0dd scripts/mail-alarm --- a/scripts/mail-alarm Thu Jul 08 11:18:01 2010 +0100 +++ b/scripts/mail-alarm Thu Apr 08 11:51:45 2010 +0100 @@ -392,11 +392,11 @@ # Run ssmtp to send mail chld_stdin, chld_stdout = os.popen2(["/usr/sbin/ssmtp", "-C%s" % fname, destination]) - chld_stdin.write("From: noreply@%s\n" % getfqdn()) - chld_stdin.write("To: %s\n" % destination) - chld_stdin.write("Subject: %s\n" % msg.generate_email_subject()) + chld_stdin.write("From: noreply@%s\n" % getfqdn().encode('utf-8')) + chld_stdin.write("To: %s\n" % destination.encode('utf-8')) + chld_stdin.write("Subject: %s\n" % msg.generate_email_subject().encode('utf-8')) chld_stdin.write("\n") - chld_stdin.write(msg.generate_email_body()) + chld_stdin.write(msg.generate_email_body().encode('utf-8')) chld_stdin.close() chld_stdout.close() os.wait()