Bug 7645 - Character encoding is not specified in license warning mail
Summary: Character encoding is not specified in license warning mail
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: License system (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.13.0
Assignee: Frida Flodin
URL:
Keywords: prosaic
Depends on:
Blocks:
 
Reported: 2021-02-12 15:03 CET by Frida Flodin
Modified: 2021-03-02 09:09 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Frida Flodin cendio 2021-02-12 15:03:43 CET
When sending license warning mails to the administrator we do not specify what encoding the text is. If there is any non-ascii characters this is a problem. The text could contain information about cities/locations which could be non-ascii. 

Since we create the license files we should encode them in UTF-8 and specify in the email that it is UTF-8 by adding this to the mail header:

> Content-Type: text/plain; charset=UTF-8 

We also need to make sure to not open the licence files in the system locale encoding.
Comment 4 Frida Flodin cendio 2021-02-18 09:43:01 CET
Fixed now. Tested the following on Ubuntu20.04 with nightly build 6752:

✓ License warning mail are sent with charset=UTF-8
✓ Sending mail with non-ASCII characters in license file
✓ License with Latin-1 and no charset gives corrupt license file
✓ Get warning mail about expired license file
✓ Get warning mail about too many users
✓ Get log warning about too old ThinLinc version, no mail sent
✓ Valid license gives no warnings
Comment 6 Samuel Mannehed cendio 2021-02-23 14:41:48 CET
The code changes look good.

I could verify the problem with build 6736, no charset header was included in the warning emails. I can also verified that jenkins build 6757.r36223 works as intended as a "Content-Type: text/plain; charset=UTF-8"-header is included in the emails.

License files with "å" in the agreement description, invalid licenses and duplicate licenses all still work.

Tested on RHEL8. Note that I had to install sendmail and enable that service in order for the warning emails to get sent.

Note You need to log in before you can comment on or make changes to this bug.