Modify

Opened 15 years ago

Closed 14 years ago

#6895 closed defect (wontfix)

Emails fail to be sent if mime-encoding set to None

Reported by: Hugh Gibson Owned by: Robert Corsaro
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

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: 288 try: 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.

Hugh

Attachments (0)

Change History (7)

comment:1 Changed 15 years ago by Derek Diget

Was getting the same error, and changing mime_encoding from "none" to "qp" removed the error and messages were sent.

comment:2 Changed 15 years ago by anonymous

Ditto. Having the same problem, "qp" fixed it.

comment:4 Changed 15 years ago by Jason Winnebeck

This is odd, because I've been fighting with the plugin all morning, and I couldn't get it to send out anything besides corrupted mails and random garbage UNLESS I set mime_encoding to none (which also happens to match the default in [notification]). If base64, I got a line of garbage from the thing, if quoted-printable I got a full mail but the MIME boundaries themselves were encoded, leading the mail clients (Outlook and Thunderbird) to display the raw content of the whole message. Only with "none" did it work.

I'm trying to work with the latest trunk on Trac 0.11 (because 0.11 and 0.11dev branches are not working for me).

comment:5 Changed 15 years ago by Robert Corsaro

yowzer. I'll look at this soon.

comment:6 Changed 15 years ago by Robert Corsaro

Status: newassigned

comment:7 Changed 15 years ago by Jason Winnebeck

I just realized that I was using "quoted-printable" instead of "qp" as the value. But I'm not sure how it got into my Trac; something seemed to have wrote that value, but is that even possible? I don't know how it got there, I just tried none because "about trac" said that's how it was set in [notification] so I tried to mirror that.

I was looking at the source code and I saw the Option said "qp" was the valid value. I see also there were "doc strings" describing the options. Is there a way to get a list of the options and that documentation? I didn't see one. I thought about compiling a list on the wiki but there are a lot of options, and it took me forever to just "figure out" what they are.

comment:8 Changed 14 years ago by Robert Corsaro

Resolution: wontfix
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Robert Corsaro.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.