changeset 62:3de67d5c26b7

experimental (tested in my setup) encoded From and To mail headers imported from: moin--main--1.5--patch-64
author Nir Soffer <nirs@freeshell.org>
date Fri, 30 Sep 2005 19:13:50 +0000
parents b29594d7d381
children d1333236adba
files MoinMoin/util/mail.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/mail.py	Fri Sep 30 18:17:53 2005 +0000
+++ b/MoinMoin/util/mail.py	Fri Sep 30 19:13:50 2005 +0000
@@ -54,8 +54,10 @@
     # Create message headers
     # Don't expose emails addreses of the other subscribers, instead we
     # use the same mail_from, e.g. "My Wiki <noreply@mywiki.org>"
-    msg['From'] = mail_from
-    msg['To'] = mail_from
+    sitename = Header(request.cfg.sitename.encode(config.charset), charset)
+    address = '"%s" <%s>' % (sitename, mail_from) 
+    msg['From'] = address
+    msg['To'] = address
     msg['Date'] = formatdate()
     msg['Message-ID'] = make_msgid()
     msg['Subject'] = Header(subject, charset)