Modify

Opened 7 years ago

Last modified 2 years ago

#7669 new defect

TracAnnouncer: don't encode pure ASCII mail headers

Reported by: Eygene Ryabinkin Owned by:
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: Dmitri, Alex Willmer Trac Release: 0.11

Description

Currently, announcer's mail is sent with all headers encoded as UTF-8. That's not cool, because it violates RFC 822: just today I got the Date field with contents

=?utf-8?q?Fri=2C_10_Sep_2010_14=3A26=3A58_-0000?=

The approach that is taken by the mainline Trac is to try ASCII charset for encoding first, and if it fails, then proceed with the specified one. I had created the patch for AnnouncerPlugin:

http://codelabs.ru/patches/trac/TracAnnouncer-r8411-dont-encode-ascii-headers.diff

It was mildly tested on our Trac with hundred mail messages and showed no regressions yet.

Attachments (0)

Change History (10)

comment:1 Changed 7 years ago by Tom

Related ticket: #7417 (Incorrect date on emails from Announcer)

comment:2 Changed 7 years ago by Robert Corsaro

rea, keep em coming!

comment:3 Changed 7 years ago by Robert Corsaro

Resolution: fixed
Status: newclosed

(In [8865]) Fixes ascii headers

Fixes #7669 Thanks rea!

comment:4 Changed 6 years ago by Dmitri

Cc: Dmitri added; anonymous removed

What about address headers? I'm unsure about RFC, but most mailers doesn't encode full address headers. Today with email_from_name = Управление задачами I have From:

=?utf-8?q?=D0=A3=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?=
 =?utf-8?q?=D0=B5_=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=D0=B0=D0=BC=D0=B8_?=
 =?utf-8?q?=3Ctrac=40example=2Ebat=2Ecom=3E?=

It displayed properly by thunderbird, but MS Outlook and gmail cant find email.

Maybe this requires a separate ticket?

comment:5 Changed 6 years ago by Robert Corsaro

Well. First we try to encode in ascii. If that fails we encode in utf-8. How would you expect it to work? What does outlook send with Управление задачами as from name?

comment:6 Changed 6 years ago by Robert Corsaro

In the set_header method of utils/mail, we should probably use the _values_ charset instead of the messages.

comment:7 Changed 6 years ago by Robert Corsaro

Resolution: fixed
Status: closedreopened

comment:8 in reply to:  5 Changed 6 years ago by Dmitri

Replying to doki_pen:

Well. First we try to encode in ascii. If that fails we encode in utf-8. How would you expect it to work? What does outlook send with Управление задачами as from name?

It display "Управление задачами <trac@…>" as name and "=?utf8?q?=D0=A3=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?utf-8?q?=D0=B5_=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=D0=B0=D0=BC=D0=B8_?= =?utf-8?q?=3Ctrac=40example=2Ecom=3E?=" as address (in [])

comment:9 Changed 5 years ago by anonymous

Cc: Alex Willmer added

comment:10 Changed 2 years ago by Ryan J Ollos

Owner: Robert Corsaro deleted
Status: reopenednew

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


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

 
Note: See TracTickets for help on using tickets.