getfider / fider

Open platform to collect and prioritize feedback
https://fider.io
GNU Affero General Public License v3.0
2.75k stars 620 forks source link

Proper encoding for email headers #1147

Open pyte1 opened 10 months ago

pyte1 commented 10 months ago

Hi,

we found a issue with the way fider handels encoding in mail headers. In our testings we used the Invitations feature to test this.

Steps to reproduce:

After sending a test invite with the subject "Test ä ö ü", i've checked the mail on our test server (Postfix/Dovecot/rspamd/amavis). Here is an example:

Subject: [Fider] ÖoorwerASD Ääööas
MIME-version: 1.0
Content-Type: text/html; charset="UTF-8"

Which is fine, as it gets displayed correctly when viewed directly on the mail server. However this is not according to spec. Subjects with non-ASCII characters should be encoded as described in RFC 1342 e.g. =?charset?encoding?encoded-text?=

Although fider uses SMTPUTF8 if the server prodivdes it this is not an option for most people. SMTPUTF8 is not supported in some software, and can lead to issues with downstream SMTP Servers that don't support it.

Is there a way you could implement a Subject encoding like this as described here:

func cSubject(subject string) string {
    return "=?utf-8?q?" + subject + "?="
}

Some further information can be found here.

Any thoughts?