Emails fail to be sent if mime-encoding set to None
|Reported by:||hgibsonNHS||Owned by:||doki_pen|
I wasn't getting any notifications through no matter what I changed.
I had announcer mime_encoding set to None (inherited from the default Notification setting).
I got a crash in email_distributor.py at line 289:
287 if not self._charset.body_encoding:
289 dummy = body.encode('ascii')
290 except UnicodeDecodeError:
291 raise TracError(_("Ticket contains non-ASCII chars. " \
292 "Please change encoding setting"))
2010-03-29 16:02:15,309 Trac[email_distributor] DEBUG: EmailDistributor is sending event as 'text/plain' to: hugh.gibson@…
2010-03-29 16:02:15,716 Trac[api] ERROR: AnnouncementSystem failed.
Traceback (most recent call last):
File "build\bdist.win32\egg\announcerplugin\api.py", line 369, in _real_send
distributor.distribute(transport, packages[transport], evt)
File "build\bdist.win32\egg\announcerplugin\distributors\email_distributor.py", line 207, in distribute
self._do_send(transport, event, fmt, msgset, fmtr)
File "build\bdist.win32\egg\announcerplugin\distributors\email_distributor.py", line 289, in _do_send
dummy = body.encode('ascii')
NameError: global name 'body' is not defined
When I changed to:
mime_encoding = qp
emails started arriving.
Looks like the code there is a hangover from previous options and hasn't been updated.