[rt-users] Commands by Email
Rich West
Rich.West at wesmo.com
Fri Aug 7 11:59:17 EDT 2009
Argh.. I have the code in place (actually, improved upon the code by
replicating some of the detection code from the original plugin), and I
can see it is working via some test code, but the commands still show up
in the content of the ticket.
So.. that leads to the question: where did you put your code in to the
Transaction_Overlay.pm file in order to get it to work? :)
I had appended it to the end of the "Content" subroutine, and I can see
from the output I have going to /tmp/content.txt that the content is
getting modified appropriately:
> # more /tmp/content.txt
> omitting Owner: rwest
> omitting Status: open
> omitting CF.{CVendors}: IBM
> omitting
> This is a test
But when I look at the web GUI, I still see the commands:
> Subject: Test
> To: support-dev at ourdomain.net
> Date: Fri, 7 Aug 2009 11:44:15 -0400
> From: <root at helpdesk-dev.ourdomain.net>
> Download (untitled) / with headers
> text/plain 71b
> Owner: rwest
> Status: open
> CF.{CVendors}: IBM
>
> This is a test
>
> --
> Rich
I just have this feeling like I have placed it in the wrong location in
the code.. :(
Thanks!
-Rich
$content = $self->loc("On [_1], [_2] wrote:",
$self->CreatedAsString, $self->CreatorObj->Name)
. "\n$content\n\n";
}
open (TEST, "> /tmp/content.txt");
# Remove quoted signature.
$content =~ s/\n--\n(.*?)$//s;
# Remove CommandByMail commands
my @content = split ("\n",$content);
my @new_content = ();
my $no_pseudoheaders = 0;
my $line = "";
foreach $line ( @content )
{
if ($line =~ /^(?:(\S+)\s*?:\s*?(.*)\s*?|)$/)
{
print TEST "omitting $line\n";
}
next if ($line =~ /^(?:(\S+)\s*?:\s*?(.*)\s*?|)$/);
print TEST "$line\n";
push ( @new_content, $line);
}
$content = join("\n", at new_content);
print $content;
close (TEST);
return ($content);
}
# }}}
=head2 Addresses
On 08/03/2009 10:20 AM, Andreas Ittgenshorst wrote:
> To remove the commands I added a few lines
> to /opt/rt3/local/lib/RT/Transaction_Overlay.pm
>
> # Remove quoted signature.
> $content =~ s/\n-- \n(.*?)$//s;
>
> + # Remove CommandByMail commands
> + my @content = split ("\n",$content);
> + my @new_content = ();
> + foreach ( @content ) {
> + if ( ( $_ =~ /^Requestor:/ ) or
> + ( $_ =~ /^CF.{Foo}:/ ) or
> + ( $_ =~ /^CF.{WhatElse}:/ ) ) {
> + next;
> + }
> + push ( @new_content, $_);
> + }
> + $content = join("\n", at new_content);
> +
> # What's the longest line like?
> my $max = 0;
>
>
>
> - Andreas
>
>
>
>> Another question, though.. is there a way to strip out the email
>> commands from the content of the ticket as it shows up in Request
>> Tracker?
>>
More information about the rt-users
mailing list