Troubleshooting Issue with RT Autoreply for Multiple Senders

Hello RT Community,

I’m currently working on customizing the auto-reply behavior in Request Tracker (RT) version 5.0.1 and encountered a challenge. I have a script that successfully stops auto-replies for a single email address, but I’m struggling to get it to work for multiple email addresses. I’m wondering if anyone has faced and solved a similar issue.

Here’s the script that works for one sender:

my $idmEmailAddr = 'audits@bank.com';
my $EmailAddr = $self->TransactionObj->CreatorObj->EmailAddress;

$RT::Logger->info("Sender's address '". $EmailAddr ."'");

return 1 if ($idmEmailAddr ne $EmailAddr);

This script is widely used, and I haven’t heard any complaints about it, so I assume it works fine.

And here’s my attempt to modify it for multiple senders:

my @idmEmailAddrs = ('audits@bank.com', 'audits@hotel.com', 'audits@hospital.com');
my $EmailAddr = $self->TransactionObj->CreatorObj->EmailAddress;

$RT::Logger->info("Sender's address '". $EmailAddr ."'");

foreach my $addr (@idmEmailAddrs) {
    if ($EmailAddr eq $addr) {
        $RT::Logger->info("Approved address: $EmailAddr");
        return 1;
    }
}

return 0;

However, this modified version does not seem to work as expected. Before I proceed to create a new test queue and configure email settings for testing (which requires further learning on my part), I wanted to ask if anyone has encountered a similar situation and found a working solution for managing auto-replies for multiple senders in RT.

I’m also aware that by removing an email address from one field while editing a user’s details and keeping it in another, all outgoing messages to that specific address can be stopped. However, our RT system is so extensive that I can’t make such decisions on behalf of our support staffs.

Additionally, I am in the process of updating RT, which requires a good amount of customization. Having said that, any new insights or suggestions would be greatly appreciated!

Thank you in advance.

I might be missing something here, but haven’t you reversed the logic in the second script? In the first scrip you’re returning 1 if the creator’s email address doesn’t match the audit email address, but in the second one you’re returning 1 if the creator’s email address matches any of the audit email addresses? Have you tried just switching over the return 1; and return 0;?