Hello, I am trying to customize one Scrip I found ( http://requesttracker.wikia.com/wiki/EmailRouting) ..
Now what I would like to do is automatically routing and creating the ticket in the right queue by looking at a queues customField MailDomain where I store the domain name like: \@gmail\.com below .. How should I debug my modifications - See Option2 - there (it is not working yet...;-) ? Thanks #-------------------------- # Domains we want to move #-------------------------- # Option 1 - list the domains here # my %domain_map = ( # '\@gmail\.com' => "TESTGmail", # '\@free\.fr' => "TESTFree" # ); # Option 2 - get all domain from queues CF my %domain_map = (); my $queues = new RT::Queues(RT::SystemUser); foreach my $queue ($queues->Next) { $domain_map { $queue->FirstCustomFieldValue('MailDomain') } = $queue->Name; } #--------------------------------------------- #Check each of our defined domains for a match #--------------------------------------------- foreach my $domainKey (keys %domain_map ){ if($self->TicketObj->RequestorAddresses =~ /^.*?${domainKey}/) { # Domain matches - move to the right queue $self->TicketObj->SetQueue($domain_map{$domainKey}); } } Pierre