Modify

Opened 4 years ago

Last modified 3 years ago

#7669 reopened defect

TracAnnouncer: don't encode pure ASCII mail headers

Reported by: rea Owned by: doki_pen
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: g1itch, willmerae 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 (9)

comment:1 Changed 4 years ago by tfotherby

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

comment:2 Changed 4 years ago by doki_pen

rea, keep em coming!

comment:3 Changed 4 years ago by doki_pen

  • Resolution set to fixed
  • Status changed from new to closed

(In [8865]) Fixes ascii headers

Fixes #7669
Thanks rea!

comment:4 Changed 4 years ago by g1itch

  • Cc g1itch added

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 follow-up: Changed 4 years ago by 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?


comment:6 Changed 4 years ago by doki_pen

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

comment:7 Changed 4 years ago by doki_pen

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:8 in reply to: ↑ 5 Changed 4 years ago by g1itch

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 3 years ago by anonymous

  • Cc willmerae added

Add Comment

Modify Ticket

Action
as reopened .
Author


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

 
Note: See TracTickets for help on using tickets.