[rt-users] Question Regarding Command By mail Extension
Joe Casadonte
joe.casadonte at oracle.com
Fri Feb 29 14:28:12 EST 2008
On 2/29/2008 2:01 PM, Greg Evans wrote:
> All of this information currently goes into comments and the things that I
> have tagged as working already work properly which is fine, though I would
> prefer that only the "Comments:" goes to comments.
I allow a CF to be set via email and I strip it out of the ticket body
using the following:
=========================
our($SETSEV_REGEXP) =
q(^(?:<span>)*\s*Set-Severity:\s*(\S+)\s*(?:</span>|<br>|\s)*\s*$);
....
#***** maybe it came in via email *****
my($AttachObj) = $self->TransactionObj->ContentObj;
if (($AttachObj) && ($AttachObj->ContentType =~ m{^text})) {
my($content) = $AttachObj->Content;
if ($content =~ m{$SETSEV_REGEXP}im) {
my($new_sev) = "\L\u$1";
$new_sev =~ s{<[^>]+>}{}g;
$CFDEFVAL = $new_sev if exists $known->{$new_sev};
# strip special commands from email content
$content =~ s{$SETSEV_REGEXP}{}igm;
# silently overwrite attachment content
$AttachObj->__Set(Field => 'Content', Value => $content);
}
}
=========================
Dealing with HTML in the email is a REAL bitch, but the above RE finally
worked....
--
Regards,
joe
Joe Casadonte
joe.casadonte at oracle.com
========== ==========
== The statements and opinions expressed here are my own and do not ==
== necessarily represent those of Oracle Corporation. ==
========== ==========
More information about the rt-users
mailing list