[rt-users] Email Queue Routing
Pierre Buhas
pierre.buhas at duolog.com
Wed Jan 19 09:09:38 EST 2011
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110119/0e5286dd/attachment.htm>
More information about the rt-users
mailing list