#1744 closed enhancement (fixed)
MIME encoding of notify mail with non-ascii project name
| Reported by: | Owned by: | Emmanuel Blot | |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10 |
| Component: | general | Version: | devel |
| Severity: | normal | Keywords: | notification email |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
On creating notify mail, X-Trac-Project: header and From: header use project name. When I use non-ascii project name, mail message will be sent with raw utf-8 bytes value without MIME encoding. This is not good.
First, I've modified like this (but not good):
Index: Notify.py
===================================================================
--- Notify.py (revision 1875)
+++ Notify.py (working copy)
@@ -136,10 +136,10 @@
msg['X-Mailer'] = 'Trac %s, by Edgewall Software' % __version__
msg['X-Trac-Version'] = __version__
projname = self.config.get('project','name')
- msg['X-Trac-Project'] = projname
+ msg['X-Trac-Project'] = Header(projname, 'utf-8')
msg['X-URL'] = self.config.get('project','url')
msg['Subject'] = Header(self.subject, 'utf-8')
- msg['From'] = '%s <%s>' % (projname, self.from_email)
+ msg['From'] = Header('%s <%s>' % (projname, self.from_email), 'utf-8')
msg['Sender'] = self.from_email
msg['Reply-To'] = self.replyto_email
msg['To'] = rcpt
X-Trac-Project: header seems be good. But From: header, which is structured header (in rfc2822 context), is so bad because entire value would be encoded.
I don't know right way of using email package to handle structured field like From: field. One easy fix to allow non-ascii project name is changing From: value not to use project name.
Index: Notify.py
===================================================================
--- Notify.py (revision 1875)
+++ Notify.py (working copy)
@@ -136,10 +136,10 @@
msg['X-Mailer'] = 'Trac %s, by Edgewall Software' % __version__
msg['X-Trac-Version'] = __version__
projname = self.config.get('project','name')
- msg['X-Trac-Project'] = projname
+ msg['X-Trac-Project'] = Header(projname, 'utf-8')
msg['X-URL'] = self.config.get('project','url')
msg['Subject'] = Header(self.subject, 'utf-8')
- msg['From'] = '%s <%s>' % (projname, self.from_email)
+ msg['From'] = 'Trac <%s>' % self.from_email
msg['Sender'] = self.from_email
msg['Reply-To'] = self.replyto_email
msg['To'] = rcpt
Attachments (0)
Change History (8)
comment:1 by , 20 years ago
| Cc: | added |
|---|
comment:2 by , 20 years ago
| Keywords: | notification email added |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:3 by , 19 years ago
| Milestone: | → 0.10 |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
comment:4 by , 18 years ago
| Cc: | removed |
|---|
comment:6 by , 17 years ago
| Milestone: | → 0.10 |
|---|---|
| Version: | → devel |
follow-up: 9 comment:8 by , 17 years ago
I need a driver for my phillips snn6500 wireless netcard or smc2632 wireless net card. I can`t make them run on linpus linux lite.
Please help.
Regards, atticyIcepemi
comment:9 by , 17 years ago
Replying to mesAllerrymug:
I need a driver for my phillips snn6500 wireless netcard or smc2632 wireless net card. I can`t make them run on linpus linux lite.
And you randomly pick up a server on the web



Fixed in the new notification implementation available in trunk.