Disable New Ticket Creation by mail if subject does not have ticket number

Hi,
I am new to RT.
Our system uses RT4. I am working on one script. In our system, new tickets are created by mail. I wanted to disable new ticket creation if the mail’s subject does not have a ticket number in it. I have prepared one script and put it in /opt/rt4/local/lib/RT/Interface/Email/Action. And added it as MailPlugin in RT_SiteConfig.pm.
The script does send an email saying that a ticket cannot be created. But along with that, I get another email with ticket ID.
I am not able to prevent Transaction from creating a ticket.
Is there any way I can achieve this?

You can’t use a scrip to stop a ticket from being created due to the way the flow in RT works. If you want to stop tickets being created if the subject line of a mail doesn’t have a ticket ID, you’ll probably need to work out how to filter these in your mail system setup before they get passed to RT.

I use the milter protocol to reject a user’s request via MUA if the mail subject does not have the correct format. Specifically milter-regex + postfix MTA. But I will migrate to spamassasin + spamass-milter due to mail header encoding UTF-8, etc. It does not reject requests sent via RT web UI.