Pierre,

Have you tried other methods? If all the email is coming into the same
Queue, why not just move them to another Queue based on the CustomFiled
Value (I'm assuming your using CommandByMail for that). I do this for
several Queues. We have a "Triage" Queue that receives the email tickets and
based on a CF value, moves the ticket to another Queue and even pre-assigns
the owner based on another CF value.

Kenn
LBNL

On Wed, Jan 19, 2011 at 6:09 AM, Pierre Buhas <pierre.bu...@duolog.com>wrote:

> 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
>
>

Reply via email to