You should probably restrict the Trigger
to only act on tickets which have a certain state or are in specific group(s). Use the Postmaster Filter
to set the spam emails to a different state, put them in a spam group, or have Zammad ignore them entirely.
Image may be NSFW.
Clik here to view.
You may need to upgrade your instance before getting more fine-grained control, but you really, really should upgrade your instance anyway.
For example, we use the following postmaster filter to immediately put spam into a specific group before it gets processed by triggers, which prevents all other triggers from being, well… triggered.