[rt-users] Suppressing outgoing email from another queue if ticket is moved into our Spam queue

Tom Lanyon tom at netspot.com.au
Tue Sep 28 18:13:02 EDT 2010


On 20/09/2010, at 5:22 AM, Gavin Henry wrote:
> So for example, once an email is filtered for the spam headers our MTA
> has added, RT moves this ticket into our Spam queue. If this ticket
> was meant for our sales queue, the sales queue still sends out an
> email even though the end queue is our Spam one.

I'm assuming that the email from your Sales queue is an auto-response or a 'new ticket created' email.

If that's the case, then you'll need your custom spam filter scrip to run first, before any of the email generating scrips run. IIRC, scrips are run in alphabetical order, so this may be as simple as prefixing the name of your spam filter scrip with a '0' (zero). This should mean that spam tickets are moved to the Spam queue *before* any other action is taken and any of the email generating scrips which run, will run against the ticket in the Spam queue and not its original queue (e.g. Sales).

Next, you'll need to stop the Spam queue from sending emails. You should be able to do this with template overrides. For every scrip which applies to the Spam queue (including global scrips) that sends email, copy the name of the template it uses and create a new template local to the Spam queue with the same name but with no contents. Queue-local templates will be used in preference to global templates and a blank template will not send any email.

Hope this helps.

Tom


More information about the rt-users mailing list