Signed-off-by: Alex Zeffertt <[email protected]>

# HG changeset patch
# User Alex Zeffertt <[email protected]>
# Date 1270720477 -3600
# Node ID 5510aad323ac10a239171b1cc199a6aa88d71b0e
# Parent  391254c2a68147acf9fe2d01cf44f548a5485f5c
CA-39663: Make mail-alarm handle unicode characters in email

Signed-off-by: Alex Zeffertt <[email protected]>

diff -r 391254c2a681 -r 5510aad323ac scripts/mail-alarm
--- a/scripts/mail-alarm	Thu Apr 08 10:51:41 2010 +0100
+++ b/scripts/mail-alarm	Thu Apr 08 10:54:37 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: nore...@%s\n" % getfqdn())
-        chld_stdin.write("To: %s\n" % destination)
-        chld_stdin.write("Subject: %s\n" % msg.generate_email_subject())
+        chld_stdin.write("From: nore...@%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()
_______________________________________________
xen-api mailing list
[email protected]
http://lists.xensource.com/mailman/listinfo/xen-api

Reply via email to