Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#6171 closed defect (fixed)

[Patch] ''Content-Transfer-Encoding'' header not allowed in the main mime container

Reported by: thomas.moschny@… Owned by: doki_pen
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: thomas.moschny@… Trac Release: 0.11

Description

(At least the) ticket notification mails sent by the plugin contain in the main header the fields:

Content-Type: multipart/related; charset="utf-8"; boundary="..."
Content-Transfer-Encoding: base64

According to RFC 1521 (5. The Content-Transfer-Encoding Header Field) that is invalid (and may confuse certain email clients, hence the ticket):

"Certain Content-Transfer-Encoding values may only be used on certain
Content-Types. In particular, it is expressly forbidden to use any
encodings other than "7bit", "8bit", or "binary" with any Content- Type
that recursively includes other Content-Type fields, notably the
"multipart" and "message" Content-Types. All encodings that are desired
for bodies of type multipart or message must be done at the innermost
level, by encoding the actual body that needs to be encoded.
"

To fix the problem, the "Content-Transfer-Encoding:" field could simply
be removed from the main header of the messages. This is valid and the
standard value "7bit" will be assumed.

Attachments (0)

Change History (5)

comment:1 Changed 5 years ago by doki_pen

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

(In [7137]) Remove Content-Transfer-Encoding from main mime container
fixes #6171

comment:2 Changed 4 years ago by thomas.moschny@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

In 1.0_a1 (r8410) the problem is there again.

comment:3 Changed 4 years ago by thomas.moschny@…

  • Cc thomas.moschny@… added
  • Summary changed from ''Content-Transfer-Encoding'' header not allowed in the main mime container to [Patch] ''Content-Transfer-Encoding'' header not allowed in the main mime container

Here's the trivial patch:

  • announcerplugin/distributors/email_distributor.py

    diff --git a/announcerplugin/distributors/email_distributor.py b/announcerplugin/distributors/email_distributor.py
    index 6df30a6..d322e94 100644
    a b class EmailDistributor(Component): 
    313313        else: 
    314314            alternate_output = None 
    315315        rootMessage = MIMEMultipart("related") 
    316         rootMessage.set_charset(self._charset) 
    317316        proj_name = self.env.project_name 
    318317        trac_version = get_pkginfo(trac.core).get('version', trac.__version__) 
    319318        announcer_version = get_pkginfo(announcerplugin).get('version',  

comment:4 Changed 4 years ago by doki_pen

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

(In [8862]) Remove invalid content-transfer-encoding

Fixes #6171
Thanks thomas.moschny@…!

comment:5 Changed 4 years ago by thomas.moschny@…

Would you mind applying that tiny patch also to the 0.11 branch?

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.