HTML -> text conversion

Hi!

While running fresh install of RT 4.2.10 on FreeBSD I get the following messages in log:
[71710] [Mon Mar 30 09:49:26 2015] [info]: Using internal Perl HTML → text conversion (/usr/local/lib/perl5/site_perl/RT/Interface/Email.pm:1818)
Somehow RT does not see HTML::FormatExternal installed.
I want to switch to HTML::FormatExternal module.
I also have HTML::FormatText installed with support for W3m.
But while adding to RT_siteconfig string
Set($HTMLFormatter, ‘/usr/local/lib/perl5/site_perl/HTML/FormatText/W3m.pm’);
I get in rt.log:
[Mon Mar 30 10:02:46 2015] [warning]: (in cleanup) Error while loading /usr/local/sbin/rt-server:
invalid module name ‘HTML::FormatText::W3m.pm’ at /usr/local/lib/perl5/site_perl/RT/Interface/Email.pm line 1830.
(/usr/local/lib/perl5/site_perl/RT.pm:390)

The main idea is to avoid double newlines for outlook emails.
I’ll appreciate any advice regarding this.

Regards,
Vlad V. Shpolyanskiy VS4241-RIPE VS603-UANIC
mailto:Vlad.Shpolyanskiy@gmail.com

But while adding to RT_siteconfig string
Set($HTMLFormatter, ‘/usr/local/lib/perl5/site_perl/HTML/FormatText/W3m.pm’);

If you want to use w3m, all you need is:

Set($HTMLFormatter, 'w3m');

The reference to setting a full path is if the w3m binary is not in
your PATH. Setting it to the .pm file is incorrect. Also note that
since w3m is the first program that RT will attempt to use, there is
generally no need to explicitly set $HTMLFormatter to w3m _at all
unless you wish to use a binary in an unusual location.

The main idea is to avoid double newlines for outlook emails.
I’ll appreciate any advice regarding this.

You may be interested in
https://docs.bestpractical.com/RT_Config#CheckMoreMSMailHeaders

  • Alex

Hi!
Please, see my comments below.

30 марта 2015 г. 20:05 пользователь “Alex Vandiver” <
alexmv@bestpractical.com> написал:

But while adding to RT_siteconfig string
Set($HTMLFormatter,
‘/usr/local/lib/perl5/site_perl/HTML/FormatText/W3m.pm’);

If you want to use w3m, all you need is:

Set($HTMLFormatter, 'w3m');

I’ve tried this - no luck.

[warning]: Could not find or run external ‘w3m’ HTML formatter in $PATH
(/sbin:/bin:/usr/sbin:/usr/bin) – you may need to install it or provide
the full path (/usr/local/lib/perl5/site_perl/RT/Interface/Email.pm:1849)

The reference to setting a full path is if the w3m binary is not in
your PATH. Setting it to the .pm file is incorrect. Also note that
since w3m is the first program that RT will attempt to use, there is
generally no need to explicitly set $HTMLFormatter to w3m _at all
unless you wish to use a binary in an unusual location.

Exactly, you are right. But RT falls back to internal converter as it does
not see w3m installed for ever reason.

The main idea is to avoid double newlines for outlook emails.
I’ll appreciate any advice regarding this.

You may be interested in
https://docs.bestpractical.com/RT_Config#CheckMoreMSMailHeaders
The does not work too.
Actually digging deeper into this turns out that that’s not double newlines
issue.
While composing email in html format Outlook adds

tag when user
press’s enter along with MsoNormal defenition class.

This class has a lot of attributes like font size, margins and so on.

But after passing through RT all these defenitions are removed.

As a result I get email with standard spacing between paragraphs which
looks like double newline.

[warning]: Could not find or run external ‘w3m’ HTML formatter in $PATH
(/sbin:/bin:/usr/sbin:/usr/bin) – you may need to install it or provide
the full path (/usr/local/lib/perl5/site_perl/RT/Interface/Email.pm:1849)

This means that your system does not have the binary installed. You
will need to “yum install w3m” or “apt-get install w3m” so that your
system has it. Having the perl module that knows how to talk to w3m
does no good if w3m itself is not installed.

If you have suggestions for how the wording of the error message quoted
above could be any clearer, I’d appreciate feedback.

Exactly, you are right. But RT falls back to internal converter as it does
not see w3m installed for ever reason.

If the w3m binary is already installed, but not
in /sbin, /bin, /usr/sbin, or /usr/bin (the $PATH listed above), then
you’ll need to set $HTMLFormatter to the full path to the w3m binary
itself – not the .pm file.

  • Alex

If the w3m binary is already installed, but not
in /sbin, /bin, /usr/sbin, or /usr/bin (the $PATH listed above), then
you’ll need to set $HTMLFormatter to the full path to the w3m binary
itself – not the .pm file.

  • Alex

That was it. Specifying path to binary did the trick.
Thanks, Alex.
No warnings now, but still have problem with formatting.
To be clear I’ve attached 2 screenshots.

  1. How it looks like when user just click on ticket.
  2. How it looks like when user click on the right to the link “Download
    untitled” for html.
    Why this 2 looks are not just the same?