Custom condition not working when checking requestor

Hi,

can anyone help me with the following custom condition? What Im
trying to do is configure some customisations to deal with spam mail
with spoofed sender that matches the actual address we are using for
the queue. Ie if the quene address is nospam@mydomain.com then we are
getting spam through with that same address set as the
requestor/sender which obviously causes a few probs. Id like to
prevent autoreplies going to these types of tickets and also to auto
delete them. Currently Im just testing the detection of these, I have
a custom condition as shown that will send me an email when the
condition is met. However its not working, can anyone help me out with
the syntax?

my $transactionType = $self->TransactionObj->Type;

if ($transactionType eq ‘Create’) {
$self->TicketObj->RequestorAddresses eq $Queue->CorrespondAddress;
return 1;
}
return;

Thanks for any help! Andy.

() can anyone help me with the following custom condition? What Im
() trying to do is configure some customisations to deal with spam mail
() with spoofed sender that matches the actual address we are using for
() the queue.

Sorry I do not know the RT magic here but even if I knew
I would suggest to ward off the spam at the SMTP level on
your mail gateway before it even reaches RT.

Ciao, Lobo

Hi Andy,

try this

my $transactionType = $self->TransactionObj->Type;

if ($transactionType eq ‘Create’ &&
$self->TicketObj->RequestorAddresses eq $Queue->CorrespondAddress) {
return 1;
}
return 0;

But keep in mind that RequestorAddresses is maybe a list of addresses
and CorrespondAddress is a single address.

ChrisAm 03.05.2010 14:46, schrieb a.smith@ukgrid.net:

Hi,

can anyone help me with the following custom condition? What Im trying
to do is configure some customisations to deal with spam mail with
spoofed sender that matches the actual address we are using for the
queue. Ie if the quene address is nospam@mydomain.com then we are
getting spam through with that same address set as the requestor/sender
which obviously causes a few probs. Id like to prevent autoreplies going
to these types of tickets and also to auto delete them. Currently Im
just testing the detection of these, I have a custom condition as shown
that will send me an email when the condition is met. However its not
working, can anyone help me out with the syntax?

my $transactionType = $self->TransactionObj->Type;

if ($transactionType eq ‘Create’) {
$self->TicketObj->RequestorAddresses eq $Queue->CorrespondAddress;
return 1;
}
return;

Thanks for any help! Andy.

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

thanks for the insight, we implement 2 different types of filtering on
our SMTP servers, but as everyone knows no spam filtering is perfect.

Anyone able to comment on the question at hand, regardless of whether
they think my mail servers are badly configured?

thanks for any ideas, Andy.

Quoting lobo:

Hi Chris,

thanks for the suggestion, I just tried this but unfortunately the
result is the same. Actually, correcting what I said in my original
post, this code as you can probably see is a custom condition for
sending an auto reply, and with your code or my original code the
problem is the same; that it IS sending the autoreply despite the
intention of the code to only autoreply if the sender email address
doesnt match the correspond address of the queue…

thanks Andy.

Quoting Chris:

Hi Andy,

Use the transaction creator instead of the ticket requestor. On a
create event, the e-mail sender is the transaction creator. The creator
will be a single entity, not a group.

my $Transaction = $self->TransactionObj;
my $sender = $Transaction->CreatorObj->EmailAddress;
if ( $sender eq $Queue->CorrespondAddress ) { bzzzzt }

Good luck,
GeneOn 5/3/2010 7:59 AM, a.smith@ukgrid.net wrote:

Hi Chris,

thanks for the suggestion, I just tried this but unfortunately the
result is the same. Actually, correcting what I said in my original
post, this code as you can probably see is a custom condition for
sending an auto reply, and with your code or my original code the
problem is the same; that it IS sending the autoreply despite the
intention of the code to only autoreply if the sender email address
doesnt match the correspond address of the queue…

thanks Andy.

Quoting Chris:

try this

my $transactionType = $self->TransactionObj->Type;

if ($transactionType eq ‘Create’ &&
$self->TicketObj->RequestorAddresses eq $Queue->CorrespondAddress) {
return 1;
}
return 0;

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Hi,

thanks for the help Chris, Ive got this working now. The working code is:

my $transactionType = $self->TransactionObj->Type;
my $ticketRequestor = lc($self->TicketObj->RequestorAddresses);

if ($transactionType eq ‘Create’ &&
$ticketRequestor ne $self->TicketObj->QueueObj->CorrespondAddress()) {
return 1;
}
return 0;

Previously Id lifted some code from an example and was using
$Queue->CorrespondAddress which isnt valid unless you�ve already
defined my Queue somewhere. So Ive updated to use the full syntax as
per above.
I got a bit confused between the return codes, initially thinking 0
was a clean exit (ie good) and not true as it acutally means.
Anyway all good now!

thanks Andy.