[rt-users] De-HTML incoming mail requests

Sean McKay seans.lists at verizon.net
Thu May 20 10:30:58 EDT 2004


Jesse/Ruslan,

We're messing with trying to just delete any HTML tags -- we don't care if
we catch an occasional greater than or less than sign. On of our programmers
came up with:

The regular expression: 

			s/<.*?>//g; 

And I've put the following into the mailgate.in Perl script after reading
the message in from STDIN:


# Read the message in from STDIN
$args{'message'} = <>;

############################## Change by Sean
$args{'message'} = s/<.*?>//g;
############################## End change by Sean

if ($opts{'extension'}) {
        $args{$opts{'extension'}} = $ENV{'EXTENSION'};
}

The only problem is that this results in an empty ticket created by
RT_System. Any tips on where this should go? Basically the goal is to
eliminate any html tag...

Thanks,
Sean 

-----Original Message-----
From: Jesse Vincent [mailto:jesse at bestpractical.com] 
Sent: Wednesday, May 19, 2004 11:56 PM
To: Ruslan U. Zakirov
Cc: Sean McKay; rt-users at lists.fsck.com
Subject: Re: [rt-users] De-HTML incoming mail requests




On Thu, May 20, 2004 at 10:52:28AM +0400, Ruslan U. Zakirov wrote:
> This option is for download link, if option is true then you get html 
> page with attachment download link, without it you get plain text.
> 
> Scrubbing before/after inserting in RT and other methods was discussed 
> here, search for info.

(RT 3.1 will scrub and display html inline.)




More information about the rt-users mailing list