Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sponsor guest registration: unexpected strings in email subject #3669

Closed
nqb opened this issue Oct 10, 2018 · 9 comments
Closed

sponsor guest registration: unexpected strings in email subject #3669

nqb opened this issue Oct 10, 2018 · 9 comments

Comments

@nqb
Copy link
Contributor

nqb commented Oct 10, 2018

To reproduce:

Create a sponsor request by visiting captive portal with a web browser configured in French
=> Sponsor will receive an email with following subject: example.lan : RequXte d'accXs invitX

If I dump %info at https://github.com/inverse-inc/packetfence/blob/devel/html/captive-portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/Sponsor.pm#L185, it contains:

[..]
$VAR7 = 'subject';
$VAR8 = "example.lan : Requ\x{ea}te d'acc\x{e8}s invit\x{e9}";
[..]

Subject seems well encoded in UTF-8 but we need to send it correctly.

@nqb
Copy link
Contributor Author

nqb commented Oct 25, 2018

@jrouzierinverse,

As we discussed together, if I put UTF8 content directly in sponsor HTML templates, I get following behaviors:

  • accented characters well displayed if PF runs on Debian 8
  • accented characters bad displayed if PF runs on CentOS 7

The only difference in emails is X-Mailer attribute:

CentOS 7 stable

X-Mailer: MIME::Lite 3.030 (F2.84; T1.38; A2.12; B3.13; Q3.13)

Debian 8.11 stable

X-Mailer: MIME::Lite 3.030 (F2.85; T2.09; A2.13; B3.14; Q3.13)

Important thing to have in mind, sponsor HTML templates are now UTF8 files in place of ASCII text.

@nqb
Copy link
Contributor Author

nqb commented Oct 25, 2018

See also #3503

@extrafu
Copy link
Member

extrafu commented Oct 25, 2018

Show me the full email headers.

@nqb
Copy link
Contributor Author

nqb commented Oct 26, 2018

@jrouzierinverse,

As seen with @extrafu, CentOS encodes email in ISO-8859:

# file deb-stable.eml
deb-stable.eml: SMTP mail, UTF-8 Unicode text

# file centos-stable.eml
centos-stable.eml: SMTP mail, ISO-8859 text

@nqb
Copy link
Contributor Author

nqb commented Jan 31, 2019

Still presents in 8.3

@nqb
Copy link
Contributor Author

nqb commented Mar 25, 2019

@jrouzierinverse : any updates ?

@nqb
Copy link
Contributor Author

nqb commented May 21, 2019

Still presents in v9 for CentOS.

@julsemaan julsemaan removed this from the PacketFence-9.1 milestone Sep 3, 2019
@luizluca
Copy link
Contributor

luizluca commented Dec 2, 2020

Normally the subject must be encoded as in:

"This is a test ç á ã ° ¿ = ?"

became

=?UTF-8?B?VGhpcyBpcyBhIHRlc3Qgw6cgw6Egw6MgwrAgwr8gPSA/?=

https://www.sendblaster.com/utf8-email-subject-encoder/

@cgx cgx closed this as completed in 4d94073 Dec 3, 2020
@nqb
Copy link
Contributor Author

nqb commented Dec 8, 2020

It works as expected on my side.

Using pl_PL on captive portal, I got following Subject received: example.lan: prośba o dostęp gościnny

I will backport to maintenance.

nqb pushed a commit that referenced this issue Dec 9, 2020
nqb pushed a commit that referenced this issue Dec 9, 2020
nqb pushed a commit that referenced this issue Dec 9, 2020
nqb pushed a commit that referenced this issue Dec 9, 2020
nqb pushed a commit that referenced this issue Dec 9, 2020
nqb pushed a commit that referenced this issue Dec 9, 2020
nqb pushed a commit that referenced this issue Dec 9, 2020
nqb pushed a commit that referenced this issue Dec 9, 2020
satkunas pushed a commit that referenced this issue Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants