text/plain part in emails escapes HTML characters

Summary

text/plain part in emails escapes HTML characters

Steps to reproduce

Have a project with 'emails on push' integration enabled. Add a new commit with some HTML special characters, e.g. <> (for example by adding a Signed-off-by to your commit msg) Push the commit, and the email will have a broken text/plain part.

This may be the same bug as gitlab-ce#31219, but that one is for CI so I'm opening a new bug in case it needs fixing in two different places.

Example Project

I reproduced this on gitlab.com with https://gitlab.com/pochu/security-tracker/commit/06ea2bb82799b73ef95688cbe8a9da28320841f1

What is the current bug behavior?

The text/plain part in commit emails escapes HTML characters. For example:

Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
[...]
Signed-off-by: Emilio Pozuelo Monfort &lt;pochu@debian.org&gt;

What is the expected correct behavior?

Those characters don't need escaping in text/plain parts

Relevant logs and/or screenshots

See the current bug behavior above, copied from an email from gitlab.com

Output of checks

This bug happens on GitLab.com

Edited Sep 04, 2018 by Nick Thomas
Assignee Loading
Time tracking Loading