RT eats table-tags in html-emails

RT is pruning the table, td and tr -tags from emails when you look at them at
the Ticket/Display.html -page, is there a way to stop RT from doing this?

I tried enabling Rich text (HTML) in my preferences and looked at
\share\html\Elements\ShowMessageStanza but I’m just a beginner when it comes
to perl.

I’m currently on RT 4.2.6 and use apache, mod_fcgi and nginx as a reverse
proxy.

Thanks in advance,
vinz

View this message in context: http://requesttracker.8502.n7.nabble.com/RT-eats-table-tags-in-html-emails-tp59339.html

RT is pruning the table, td and tr -tags from emails when you look at them at
the Ticket/Display.html -page, is there a way to stop RT from doing this?

I tried enabling Rich text (HTML) in my preferences and looked at
\share\html\Elements\ShowMessageStanza but I’m just a beginner when it comes
to perl.

I’m currently on RT 4.2.6 and use apache, mod_fcgi and nginx as a reverse
proxy.

Thanks in advance,
vinz

Hi Vinz,

You need to adjust the allowed tags in the HTML::Scrubber object by adding a
Web_Local.pm:

https://www.bestpractical.com/docs/rt/4.2/RT/Interface/Web.html

Here is what I am using because I wanted to allow the tables to have colors:

package HTML::Mason::Commands;

Let tables through

push @SCRUBBER_ALLOWED_TAGS, qw(TABLE THEAD TBODY TFOOT TR TD TH);

Allow bgcolor to be set

$SCRUBBER_ALLOWED_ATTRIBUTES{bgcolor} = ‘^\s*#[a-fA-F0-9]{3,6}\s*’;
1;

Make sure to set the option in your RT_SiteConfig.pm

Set($TrustHTMLAttachments, 1);

I think that is all I needed to do. Then restart after clearing your Mason
cache.

Regards,
Ken

Another solution in recent versions of RT is to install the HTML::Gumbo
module from CPAN, which should automatically enable correct display of all
HTML in tickets without any coding.On Sat, 17 Jan 2015 1:11 am ktm@rice.edu ktm@rice.edu wrote:

On Fri, Jan 16, 2015 at 06:49:05AM -0700, vinz wrote:

RT is pruning the table, td and tr -tags from emails when you look at
them at
the Ticket/Display.html -page, is there a way to stop RT from doing this?

I tried enabling Rich text (HTML) in my preferences and looked at
\share\html\Elements\ShowMessageStanza but I’m just a beginner when it
comes
to perl.

I’m currently on RT 4.2.6 and use apache, mod_fcgi and nginx as a reverse
proxy.

Thanks in advance,
vinz

Hi Vinz,

You need to adjust the allowed tags in the HTML::Scrubber object by adding
a
Web_Local.pm:

RT::Interface::Web - RT 4.2.17 Documentation - Best Practical

Here is what I am using because I wanted to allow the tables to have
colors:


package HTML::Mason::Commands;

Let tables through

push @SCRUBBER_ALLOWED_TAGS, qw(TABLE THEAD TBODY TFOOT TR TD TH);

Allow bgcolor to be set

$SCRUBBER_ALLOWED_ATTRIBUTES{bgcolor} = ‘^\s*#[a-fA-F0-9]{3,6}\s*’;
1;

Make sure to set the option in your RT_SiteConfig.pm

Set($TrustHTMLAttachments, 1);

I think that is all I needed to do. Then restart after clearing your Mason
cache.

Regards,
Ken

Looking at the RT_Config documentation, I think you might need to enable
the $TrustHTMLAttachments setting. I know I’ve enabled that in my local
installation.

You might also need to increase the $MaxInlineBody setting from its default
of 12,000 bytes (or set it to 0 to disable size limiting altogether), since
things with HTML tables in my experience tend to frequently exceed that
limit.On 19 January 2015 at 18:41, Guadagnino Cristiano < guadagnino.cristiano@creval.it> wrote:

I did this while upgrading to 4.2.9 but nothing changed in the dispplay
of html tables.
Is there something more that needs to be done?
IIRC this is not very well documented… just a note among the release
notes.

T.I.A.

Cris


Da: Alex Peters alex@peters.net alex@peters.net
Inviato: Sat Jan 17 2015 01:09:38 GMT+0100 (CET)
A: ktm@rice.edu ktm@rice.edu ktm@rice.edu, vinz
vinzenz.sinapius@tracetronic.de vinzenz.sinapius@tracetronic.de
Cc: rt-users@lists.bestpractical.com
rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] RT eats table-tags in html-emails

Another solution in recent versions of RT is to install the HTML::Gumbo
module from CPAN, which should automatically enable correct display of all
HTML in tickets without any coding.

I have both already set. Is it working in your system?
Did you need to add something to the config command line?

Da: Alex Peters alex@peters.netmailto:alex@peters.net
Inviato: Mon Jan 19 2015 08:48:45 GMT+0100 (CET)
A: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] RT eats table-tags in html-emails
Looking at the RT_Config documentation, I think you might need to enable the $TrustHTMLAttachments setting. I know I’ve enabled that in my local installation.

You might also need to increase the $MaxInlineBody setting from its default of 12,000 bytes (or set it to 0 to disable size limiting altogether), since things with HTML tables in my experience tend to frequently exceed that limit.On 19 January 2015 at 18:41, Guadagnino Cristiano <guadagnino.cristiano@creval.itmailto:guadagnino.cristiano@creval.it> wrote:
I did this while upgrading to 4.2.9 but nothing changed in the dispplay of html tables.
Is there something more that needs to be done?
IIRC this is not very well documented… just a note among the release notes.

T.I.A.

Cris

Da: Alex Peters alex@peters.netmailto:alex@peters.net
Inviato: Sat Jan 17 2015 01:09:38 GMT+0100 (CET)
A: ktm@rice.edumailto:ktm@rice.edu ktm@rice.edumailto:ktm@rice.edu, vinz vinzenz.sinapius@tracetronic.demailto:vinzenz.sinapius@tracetronic.de
Cc: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] RT eats table-tags in html-emails

Another solution in recent versions of RT is to install the HTML::Gumbo module from CPAN, which should automatically enable correct display of all HTML in tickets without any coding.

HTML tables are mostly displaying as expected on my installation (ignoring
missing images and CSS). I’m running v4.2.7 though; I guess it’s possible
that a regression has occurred in a later version.

There are no other relevant settings in my RT_SiteConfig.pm file, and I’m
90% sure that I didn’t add any special flags when I ran the “configure”
script.

Looking at the code, HTML::Gumbo would be ignored if it failed to install
properly for some reason. Are you seeing anything interesting in RT’s
debug logs? I remember having to grab a very fresh HTML::Gumbo version
because of some installation issue I encountered with an older (but still
somewhat recent) one.

Lastly, you’ve probably already done this, but for the sake of
documentation, RT would need to be restarted after the installation of this
module.On 19 January 2015 at 18:56, Guadagnino Cristiano < guadagnino.cristiano@creval.it> wrote:

I have both already set. Is it working in your system?
Did you need to add something to the config command line?


Da: Alex Peters alex@peters.net alex@peters.net
Inviato: Mon Jan 19 2015 08:48:45 GMT+0100 (CET)
A: rt-users@lists.bestpractical.com rt-users@lists.bestpractical.com
rt-users@lists.bestpractical.com
Cc: Guadagnino Cristiano guadagnino.cristiano@creval.it
guadagnino.cristiano@creval.it
Oggetto: Re: [rt-users] RT eats table-tags in html-emails

Looking at the RT_Config documentation, I think you might need to enable
the $TrustHTMLAttachments setting. I know I’ve enabled that in my local
installation.

You might also need to increase the $MaxInlineBody setting from its
default of 12,000 bytes (or set it to 0 to disable size limiting
altogether), since things with HTML tables in my experience tend to
frequently exceed that limit.

On 19 January 2015 at 18:41, Guadagnino Cristiano < guadagnino.cristiano@creval.it> wrote:

I did this while upgrading to 4.2.9 but nothing changed in the dispplay
of html tables.
Is there something more that needs to be done?
IIRC this is not very well documented… just a note among the release
notes.

T.I.A.

Cris


Da: Alex Peters alex@peters.net alex@peters.net
Inviato: Sat Jan 17 2015 01:09:38 GMT+0100 (CET)
A: ktm@rice.edu ktm@rice.edu ktm@rice.edu, vinz
vinzenz.sinapius@tracetronic.de vinzenz.sinapius@tracetronic.de
Cc: rt-users@lists.bestpractical.com
rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] RT eats table-tags in html-emails

Another solution in recent versions of RT is to install the HTML::Gumbo
module from CPAN, which should automatically enable correct display of all
HTML in tickets without any coding.

Thank you all for your replies.
I used the solution from Ken. I enabled HTML-Attachments and created a \local\lib\RT\Interface\Web_Local.pm
Maybe I’ll try the “HTML::Gumbo”-Solution to.

Regards,
VinzVon: Guadagnino Cristiano [via RequestTracker] [mailto:ml-node+s8502n59357h5@n7.nabble.com]
Gesendet: Montag, 19. Januar 2015 08:58
An: Sinapius, Vinzenz
Betreff: Re: RT eats table-tags in html-emails

I have both already set. Is it working in your system?
Did you need to add something to the config command line?

Da: Alex Peters [hidden email]</user/SendEmail.jtp?type=node&node=59357&i=0>
Inviato: Mon Jan 19 2015 08:48:45 GMT+0100 (CET)
A: [hidden email]</user/SendEmail.jtp?type=node&node=59357&i=1> [hidden email]</user/SendEmail.jtp?type=node&node=59357&i=2>
Cc: Guadagnino Cristiano [hidden email]</user/SendEmail.jtp?type=node&node=59357&i=3>
Oggetto: Re: [rt-users] RT eats table-tags in html-emails
Looking at the RT_Config documentation, I think you might need to enable the $TrustHTMLAttachments setting. I know I’ve enabled that in my local installation.

You might also need to increase the $MaxInlineBody setting from its default of 12,000 bytes (or set it to 0 to disable size limiting altogether), since things with HTML tables in my experience tend to frequently exceed that limit.

Alex,
you were right: HTML::Gumbo installation failed on my box, but I did not notice it initially.

Trying to reinstall HTML::Gumbo now, I noticed that ‘libtoolize’ was missing, so I installed it.
Unfortunately it fails again because it wants autoconf >= v2.65, and there is only v2.63 in CentOS repository.

I’ll have to wait until CentOS updates the repos.

Thank you!

Bye
Cris

Da: Alex Peters alex@peters.netmailto:alex@peters.net
Inviato: Mon Jan 19 2015 09:06:29 GMT+0100 (CET)
A: Guadagnino Cristiano guadagnino.cristiano@creval.itmailto:guadagnino.cristiano@creval.it
Oggetto: Re: [rt-users] RT eats table-tags in html-emails
HTML tables are mostly displaying as expected on my installation (ignoring missing images and CSS). I’m running v4.2.7 though; I guess it’s possible that a regression has occurred in a later version.

There are no other relevant settings in my RT_SiteConfig.pm file, and I’m 90% sure that I didn’t add any special flags when I ran the “configure” script.

Looking at the code, HTML::Gumbo would be ignored if it failed to install properly for some reason. Are you seeing anything interesting in RT’s debug logs? I remember having to grab a very fresh HTML::Gumbo version because of some installation issue I encountered with an older (but still somewhat recent) one.

Lastly, you’ve probably already done this, but for the sake of documentation, RT would need to be restarted after the installation of this module.

Cristiano Guadagnino

Servizio Sistemi Dipartimentali, Periferici e DB
Bankadati Servizi Informatici Soc.Cons.P.A.
Gruppo bancario Credito Valtellinese
VIA TRENTO, 22 - 23100 SONDRIO
tel +39 0342522172 - fax +39 0342522997
guadagnino.cristiano@creval.it
www.creval.ithttp://www.creval.it

Il presente messaggio non è di natura personale ma inviato per esigenze lavorative; l’eventuale messaggio di risposta potrà essere conosciuto anche da altri soggetti diversi dall’originatore di questo messaggio per dette esigenze o per controllo aziendale. Questo messaggio, corredato dei relativi allegati, contiene informazioni da considerarsi strettamente riservate, ed è destinato esclusivamente al destinatario sopra indicato, il quale è l’unico autorizzato ad usarlo, copiarlo e, sotto la propria responsabilità, diffonderlo. Chiunque ricevesse questo messaggio per errore o comunque lo leggesse senza esserne legittimato è avvertito che trattenerlo, copiarlo, divulgarlo, distribuirlo a persone diverse dal destinatario è severamente proibito, ed è pregato di rinviarlo immediatamente al mittente distruggendone l’originale.On 19 January 2015 at 18:56, Guadagnino Cristiano <guadagnino.cristiano@creval.itmailto:guadagnino.cristiano@creval.it> wrote:
I have both already set. Is it working in your system?
Did you need to add something to the config command line?

Da: Alex Peters alex@peters.netmailto:alex@peters.net
Inviato: Mon Jan 19 2015 08:48:45 GMT+0100 (CET)
A: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Cc: Guadagnino Cristiano guadagnino.cristiano@creval.itmailto:guadagnino.cristiano@creval.it
Oggetto: Re: [rt-users] RT eats table-tags in html-emails
Looking at the RT_Config documentation, I think you might need to enable the $TrustHTMLAttachments setting. I know I’ve enabled that in my local installation.

You might also need to increase the $MaxInlineBody setting from its default of 12,000 bytes (or set it to 0 to disable size limiting altogether), since things with HTML tables in my experience tend to frequently exceed that limit.

On 19 January 2015 at 18:41, Guadagnino Cristiano <guadagnino.cristiano@creval.itmailto:guadagnino.cristiano@creval.it> wrote:
I did this while upgrading to 4.2.9 but nothing changed in the dispplay of html tables.
Is there something more that needs to be done?
IIRC this is not very well documented… just a note among the release notes.

T.I.A.

Cris

Da: Alex Peters alex@peters.netmailto:alex@peters.net
Inviato: Sat Jan 17 2015 01:09:38 GMT+0100 (CET)
A: ktm@rice.edumailto:ktm@rice.edu ktm@rice.edumailto:ktm@rice.edu, vinz vinzenz.sinapius@tracetronic.demailto:vinzenz.sinapius@tracetronic.de
Cc: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] RT eats table-tags in html-emails

Another solution in recent versions of RT is to install the HTML::Gumbo module from CPAN, which should automatically enable correct display of all HTML in tickets without any coding.