[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH] Make mail-alarm handle unicode chars in email



# HG changeset patch
# User Alex Zeffertt <alex.zeffertt@xxxxxxxxxxxxx>
# Date 1270723905 -3600
# Node ID 0dbc5306a0ddb1c65de472a524594d9b8a48d558
# Parent  a182192d6af59e2f05bae57d02c63ab42cba6639
CA-39663: Make mail-alarm handle unicode characters in email

Signed-off-by: Alex Zeffertt <alex.zeffertt@xxxxxxxxxxxxx>

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()
 scripts/mail-alarm |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


Attachment: xen-api.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.