Script to reject user blacklist

I want to write a script to reject ticket creation for an array of users I want to blacklist. I don’t want to use procmail or an MTA for this. Is there any documentation or examples available?

TIA.