[rt-users] scrip: how to check if correspondence from requestor
Ole Craig
ocraig at stillsecure.com
Mon Sep 17 18:10:11 EDT 2007
On Fri, 2007-09-14 at 09:35 -0700, Gene LeDuc wrote:
> Hi Phil,
>
> To correct my previous post, try this for your condition code:
>
> my $ReqList =
> $self->TicketObj->Requestors->MemberEmailAddressesAsString;
> my $Sender = $self->TransactionObj->CreatorObj->EmailAddress;
> return $self->TransactionObj->Type eq "Correspond"
> && $self->TicketObj->Status eq "reqappr"
> && $ReqList =~ /$Sender/;
>
> You just grab the list of requestor e-mail addresses and see if the
> sender's address is one of them.
>
ObPerlPedant: That'll still be a little loose, you might want to anchor
your regex. If your sender is "john.doe at hotmail.com" the code below
would still match "not.the.real.john.doe at hotmail.com" -- a corner case,
yes, but one with a nonzero chance of occurring given the way people
tend to construct accounts at some of the free webmail providers.
A quick'n'dirty fix might be something like this:
$ReqList =~ /^(.*,)$Sender[,$]/;
--
/Ole Craig
Security Engineer
Team lead, customer support
ocraig at stillsecure.com
303-381-3802 main support line
303-381-3824 my voicemail
303-381-3880 fax
www.stillsecure.com
More information about the rt-users
mailing list