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

mail_tt2/moderate.tt2 : mailto: links intermittantly line wrapped #709

Closed
dpc22 opened this issue Jul 25, 2019 · 11 comments · Fixed by #711
Closed

mail_tt2/moderate.tt2 : mailto: links intermittantly line wrapped #709

dpc22 opened this issue Jul 25, 2019 · 11 comments · Fixed by #711
Labels
Milestone

Comments

@dpc22
Copy link
Contributor

dpc22 commented Jul 25, 2019

Version

6.2.44 on Ubuntu 18.04 and RHEL 7

Installation method

Ubuntu 18.04: From source

RHEL 7: rpm from https://copr.fedorainfracloud.org/coprs/xavierb/sympa/

Expected behavior

mailto: links generated by mail_tt2/moderate.tt2 : should look something like:

<mailto:[email protected]?subject=DISTRIBUTE%20test-dpc99%20e5269cab61a61635dcf13baa0724d920>

Actual behavior

A line break is occasionally installed after the '-' character on Ubuntu 18.04 (but not RHEL 7),
so I end up with:

<mailto:[email protected]?subject=DISTRIBUTE%20test-
dpc99%20e5269cab61a61635dcf13baa0724d920>

This doesn't work correctly when people click on the link. You end up with

Subject: DISTRIBUTE test-

rather than:

Subject: DISTRIBUTE test-dpc99 e5269cab61a61635dcf13baa0724d920

Additional information

Ubuntu 18.04 is using libunicode-linebreak-perl 0.0.20160702-1build

RHEL is using perl-Unicode-LineBreak-2016.003-1.el7.x86_64

I think that the problem is the following in .../lib/Sympa/Tools/Text.pm

sub wrap_text {
 ...
        Prep          => 'NONBREAKURI',
        prep          => [$email_re, sub { shift; @_ }],

as that works reliably on Ubuntu 18.04 if I remove the second line.

I attach a small Perl test script:

test-unicode-linebreak.pl.txt

which works reliability on RHEL 7 but erratically on Ubuntu 18.04

@racke
Copy link
Contributor

racke commented Jul 25, 2019

Text::LineFold names only Prep. I suppose we can safely remove the prep option.

@ikedas
Copy link
Member

ikedas commented Jul 25, 2019

https://metacpan.org/changes/distribution/Unicode-LineBreak about version 2019.001:

  • Fix: Text::LineFold: new() & config() did not allow multiple Prep option

The latest release is preferred. Using keys “Prep” and “prep” (they are not unique in cases) is workaround for earlier releases.

@racke
Copy link
Contributor

racke commented Jul 25, 2019

OK, but we could determine the right key by looking at the Text::LineFold version?

@ikedas
Copy link
Member

ikedas commented Jul 26, 2019

However, many distributions do not bundle 2019.001. That's why I didn't update cpanfile but took workaround.

@ikedas
Copy link
Member

ikedas commented Jul 26, 2019

@dpc22, could you please show versions of these?

  • perl
  • sombok (Deb: libsombok3 / EL: sombok)
  • libthai (Deb: libthai0 / EL: libthai)
  • Unicode-LineBreak (Deb: libunicode-linebreak-perl / EL: perl-Unicode-LineBreak)

Thanks.

@ikedas ikedas added the bug label Jul 26, 2019
@ikedas ikedas added this to the 6.2.46 milestone Jul 26, 2019
@ikedas
Copy link
Member

ikedas commented Jul 26, 2019

I checked if wrapping reproduces using @dpc22's test script on my environment.

U-L \ Perl 5.16.3 5.28.2
2016.003 No Occasionally reproduced
2016.007_02 No Occasionally reproduced
2019.001 No No

(N.B.: sombok 2.4.0, libthai 0.1.14 and Perl 5.16.3 are installed with RPM. Others are isntalled from source.)

This looks due to hash randomization introduced by recent Perl. U-L 2019.001 won't be affacted by such randomization.

@racke, you are right. We have to introduce recent version of U-L.

@dpc22
Copy link
Contributor Author

dpc22 commented Jul 26, 2019

Ubuntu 18.04:

  • Perl 5.26.1-6ubuntu0.3
  • libsombok3:amd64 2.4.0-1
  • libthai0:amd64 0.1.27-2
  • libunicode-linebreak-perl 0.0.20160702-1build2

RHEL 7:

  • perl-5.16.3-294.el7_6.x86_64
  • sombok-2.4.0-2.el7.x86_64
  • libthai-0.1.14-9.el7.x86_64
  • perl-Unicode-LineBreak-2016.003-1.el7.x86_64

All of which should be the latest versions for those distributions.

RHEL 7 is actually the platform that I care about for a production environment: Ubuntu is just running on my workstation as a test platform. RHEL 7 does seems to work at the moment, although it is clearly using quite an old version of perl-Unicode-LineBreak-2.

@ikedas
Copy link
Member

ikedas commented Jul 28, 2019

@dpc22 thanks for information. I prepared U-L-2019.001 for RHEL7. Could you please check if it will solve the problem?

ikedas added a commit to ikedas/sympa that referenced this issue Jul 28, 2019
@dpc22
Copy link
Contributor Author

dpc22 commented Jul 29, 2019

That RPM certainly seems to work on RHEL 7: thank you.

As it happens the existing perl-Unicode-LineBreak-2016.003-1 seemed to be working anyway (presuming using the prep/Prep workaround).

However there is no guarantee that Redhat won't update to a broken version in the next 7.x release, so having a workaround is really helpful.

Thanks.

@xavierba
Copy link
Contributor

Unicode::LineBreak is not in base RHEL/CentOS but in the EPEL add-on repo. As I'm the maintainer for this package, I have updated it to 2019.001 for EL7, EL6 and F29 (F30 and F31 are already shipping 2019.001). It should appear soon in updates-testing/epel-testing repos.
I also maintain sombok, but it is up to date in all supported Fedora and EPEL releases.

Please note sympa itself is on its way to Fedora/EPEL (already available in updates-testing/epel-testing) and the sympa COPR repo will likely disappear in a not too distant future. I'll keep the sympa-beta COPR repo for testing purpose though.

@ikedas
Copy link
Member

ikedas commented Aug 1, 2019

@xavierba, thanks for quick work! And thanks much for maintenance of RPM packages!

U-L-2019.001 RPM created by me, if it has already been installed, will be safely updated by EPEL package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants