Change behaviour of RT when it receives specific emails


RT’s default behaviour is that when it receives an email with [{$rtname}
#{$Ticket->id}] in the subject line, that the content of the email is
appended to the ticket with $Ticket->id as its ID.

I want to exempt this behaviour.
When an email has the ‘To’ address as ‘’ AND the Subject
line contains [{$rtname} #{$Ticket->id}] AND the $Ticket->Queue !=
‘Feedback’, then I want the email to go to (create a new ticket in) the
Feedback queue (in default behaviour it would append to the already
existing resolved ticket).

The problem is: where do I pick up the incoming email, check its 'To’
field for ‘feedback’ check the subject line for $Ticket->id, grab the
Queue for that ticket ($Ticket->Queue) and make some decisions as to
where to send the email. For example, I could change the subject line
(so default behaviour doesn’t work).
Since I am invoking rt-mailgate from procmail, which currently catches
on ‘TO feedback’, I could intervene at that level, and write a script
that then calls rt-mailgate after checking for the other conditions.

There may be a simpler way to do this,
Any suggestions welcome.

Kind regards.

Luke Vanderfluit.
Internode Systems Pty. Ltd.


All the checking and parsing of the email is done in

Subroutine Gateway in $RT_HOME/lib/RT/Interface/
using the helper module $RT_HOME/lib/RT/

Look at these two specially the Gateway routine in


Quoting Luke Vanderfluit