Automatically adding new email tickets to a specific queue based on sender email-address

Hi,

is it somehow possible (using rt 2.11) to automatically assign tickets
incoming via email to a Specific Queue based on the requesters from-address?

What I want to achieve is, that any request from user@domain.dom is added to
queue “domain”, but an request from me@home.dom is assigned to queue “home”.

Thanks
Stefan
PS: plese CC me, I’m on Digest

http://www.StefanSeiz.com
Spamto: bin@imd.net

Stefan Seiz wrote:

What I want to achieve is, that any request from user@domain.dom is added to
queue “domain”, but an request from me@home.dom is assigned to queue “home”.

Sounds like yet another job for procmail…

:0

  • ^From: .*@domain.dom
    | /path/to/rt-mailgate --queue domain --action correspond

:0

  • ^From: .*@home.dom
    | /path/to/rt-mailgate --queue home --action correspond

:0
| /path/to/rt-mailgate --queue default --action correspond
Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances

Probably not what you’re looking for but we have a perl script that compares the sender to our directory and sets the queue based on the ou of the user. If that person’s not in our directory then the ticket is placed in the “General” queue.

/etc/mail/aliases:
support: “|/opt/rt2/bin/pickque”

/opt/rt2/bin/pickque:
#!/usr/bin/perl

my $filter = “”;

$random = int( rand(64000) ) + 1;

open(OUTFILE,">/tmp/msg$random.txt") or die “Can’t open output file $!”;
while ($line = ) {

    if ($line =~ /From:/) {
            $filter = "uid=";
            ($w1,$w2) = split("<",$line);
            ($uid,$domain) = split("@",$w2);
            $filter .= $uid;
            $entry = `ldapsearch -b \"o=True North\" -s sub -h chidir1 $filter dn`;
            $queue="general";
            if ($entry) {
                    $dn=$entry;
                    if ($dn =~ /Asia Pacific/) {
                            $queue = "Region - Asia/Pacific";
                    }
                    if ($dn =~ /Europe/) {
                            $queue = "Region - Europe";
                    }
                    if ($dn =~ /Latin America/) {
                            $queue = "Region - South America";
                    }
                    if ($dn =~ /North America/) {
                            $queue = "Region - North America";
                    }
            }
            #print "$queue\n";
    }
    print OUTFILE $line;

}
close OUTFILE;
$result = /opt/rt2/bin/rt-mailgate --queue \'$queue\' --action correspond < /tmp/msg$random.txt;
unlink “/tmp/msg$random.txt”;

Probably not what you’re looking for but we have a perl script that compare=
s the sender to our directory and sets the queue based on the ou of the use=
r. If that person’s not in our directory then the ticket is placed in the =
“General” queue.

/etc/mail/aliases:
support: “|/opt/rt2/bin/pickque”

/opt/rt2/bin/pickque:
#!/usr/bin/perl

Not exactly what i wished for, but a very handy script indeed. I’ll sure
keep it around. Thanks!

Seems for the time being, i do the FROM address filtering already on my
mailserver (CommuniGatePro) which has a powerful rules system which will
then launch the RT commandline-tool with the propper --queue. I just wanted
to avoid having yet another 10 rules within my mailserver…

Thanks again.

Stefan Seiz http://www.StefanSeiz.com
Spamto: bin@imd.net