Having stripmime put a clickable link

(Hesitated between rt-user and rt-devel, decided that RT1
belongs on rt-users… that right?)

I just installed stripmime, and I’m a bit disappointed that I
don’t get a clickable link in the web ui.

First off, I modified the script to only put the first
attachment in-line (if it’s text), since I expect large text
attachments that I don’t want in the interface. That was a
breeze.

Than I modified the stripmime script to output a HTML HREF
instead of just the plaintext URL (should have realized it
wasn’t that simple) and saw that the output is HTML-sanitized,
which was to be expected, after all.

I’m quite concerned about not having problems with malicious or
bizarre mails wreaking havoc in my interface, so I’m certainly
not going to remove what protection I have against that, but I
do want clickable links too.

Any way? Maybe after the sanitation is done I could sed
the output looking for the distinctive (text) link to
https://myhost/stripmime/, or even with a custom unusual token
that I’d make stripmime output? Anybody done that (where is the
sanitation done?), or have another idea?

Apologies if this has been discussed before.

#include <std_disclaim.h> Lorens Kockum

hi lorens,

i did the following:

i added a subroutine ‘print_url_list’ to ‘support.pm’ and called this routine
at the end of ‘print_transaction’ in ‘support.pm’. it prints a list of all
http-urls occurring in the transaction (not only stripmime links) as clickable
urls at the end of each transaction.

the regexp used to detect http-urls is not very good :-}. you’ll sometimes
have to correct the url in your browser, but that should not be a big problem
and - at least for me - is better than nothing.

the rest of the transaction is printed as preformatted text (

), therefore
you cannot have any clickable links in it. for ‘optical conformance’ the url
list is printed in teletype style ().

any feedbacks for enhancements are welcome.

this is tne new subroutine

sub print_url_list {
my ($value) = shift;

$url_regexp = 'http://([\w-])+(\.\1)*(/?[^ ])*[^\.]';

if ($value =~ /$url_regexp/) {
  print "<tt><b>URL-List for this Transaction:</b><p>\n";

  while ($value =~ /$url_regexp/g) {
    $url = $&;
    print "* <a href=\"$url\" target=\"_new\">$url</a><br>\n";
  }

  print "</tt>\n";
}

}

this is the modified print_transaction

sub print_transaction {

...codecodecode...

print "<pre>";
&print_html($body);
print "</pre>";

&print_url_list($body);  #add here print_url_list

}

         frank

(Hesitated between rt-user and rt-devel, decided that RT1
belongs on rt-users… that right?)

I just installed stripmime, and I’m a bit disappointed that I
don’t get a clickable link in the web ui.

First off, I modified the script to only put the first
attachment in-line (if it’s text), since I expect large text
attachments that I don’t want in the interface. That was a
breeze.

Than I modified the stripmime script to output a HTML HREF
instead of just the plaintext URL (should have realized it
wasn’t that simple) and saw that the output is HTML-sanitized,
which was to be expected, after all.

I’m quite concerned about not having problems with malicious or
bizarre mails wreaking havoc in my interface, so I’m certainly
not going to remove what protection I have against that, but I
do want clickable links too.

Any way? Maybe after the sanitation is done I could sed
the output looking for the distinctive (text) link to
https://myhost/stripmime/, or even with a custom unusual token
that I’d make stripmime output? Anybody done that (where is the
sanitation done?), or have another idea?

Apologies if this has been discussed before.


#include <std_disclaim.h> Lorens Kockum


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Frank Thommen, Informatik Support Gruppe, D-INFK, ETH Zuerich
E-Mail: thommen@inf.ethz.ch; Tel: +41-1-63 27208 (Mo-Do)

Hi All,
I am trying to write a web page page that allows end users to
display their ticket. I am using the following sort of code…

open (IN,"/opt/rt/bin/rt -show $ticket_no|")
while ()
{
print $_;
}
close(IN);

What is happening is that I am getting the following error

"Welcome to Request Tracker 1.0.7
You don’t have permission to display request #123 "

Which I admit is obvious so I added a users called apache (the username
the web server is running under) and gave the user permission to view
tickets. But it still doesn’t work. Could anyone give me some sort of
insight to what is going on?

Cheers

Rus

Russell Foster
EMEA IT Unix Systems Administrator
Art Technology Group

LISTER : The red, green, and blue alert signs are all flashing! What the smeg is
happening?
KRYTEN : Well, either we’re under attack, sir, or we’re having a disco.
Red Dwarf Season VII - Stoke Me A Clipper