WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

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

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] Make mail-alarm handle unicode chars in email
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Thu, 8 Jul 2010 11:19:13 +0100
Delivery-date: Thu, 08 Jul 2010 03:27:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
# 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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] Make mail-alarm handle unicode chars in email, David Scott <=