Add Postmaster filter support for custom email headers (specifically Gmail's X-Gm-Spam and X-Gm-Phishy)

1) What is your original issue/pain point you want to solve?

We use Google Workspace/Gmail, which has one of the strongest spam filters on the market. We want to import our Gmail Spam folder directly into Zammad so our agents can review it for false positives without needing direct login access to the central Gmail inbox. However, when these emails are fetched by Zammad, we cannot filter or route them based on the X-Gm-Spam or X-Gm-Phishy email headers, because the Postmaster filter does not currently offer these specific headers (or a way to define custom headers) in the condition selection.

2) Which are one or two concrete situations where this problem hurts the most?

  • Reviewing False Positives: When a legitimate customer email is incorrectly flagged as spam by Gmail, it lands in the spam folder. If we pull that folder into Zammad, we have no automated way via the Postmaster filter to tag it as “Potential Spam” or route it to a dedicated “Spam Review” group based on its header, causing it to mix with standard tickets or forcing us to use manual workarounds.
  • Security and Compliance: We want to keep our agents inside Zammad and prevent them from needing direct credentials to our Gmail environment just to check the spam folder. Without the ability to filter by these headers in Zammad, maintaining this security boundary is highly inefficient.

3) Why is it not solvable with the Zammad standard?

The current Postmaster filter conditions in Zammad only allow filtering by standard, predefined email fields (Subject, From, To, Body, etc.). It does not expose X-Gm-Spam or X-Gm-Phishy, nor does it offer a generic “Custom Header” field where administrators can input specific headers to evaluate.

4) What is your expectation/what do you want to achieve?

I would like the Postmaster filter to either: A) Natively include X-Gm-Spam and X-Gm-Phishy in the condition dropdown list. B) (Ideally) Allow administrators to add arbitrary/custom email headers in the Postmaster filter conditions so we can build routing rules based on any specific header provided by our mail server.

Your Zammad environment:

  • Average concurrent agent count: ~70
  • Average tickets a day: ~833 (handling approx. 25,000 emails per month)
  • What roles/people are involved: Support Agents reviewing tickets for false positives, and Zammad Administrators building the Postmaster filters.

Anything else which you think is useful to understand your use case:

Implementing a “Custom Header” field in the Postmaster filter wouldn’t just solve this for Gmail users; it would benefit anyone using advanced external spam firewalls (like Barracuda, Proofpoint, or Mimecast) that stamp emails with custom X- headers before delivering them to Zammad.

This is a duplicate. There is definitely already a feature request on this

Hi @MrGeneration ,

I only found a closed one from 2019: Add Google g-suite specific SPAM recognition mail headers.

Adding those options will add huge benefit for GMail-Users, but shouldn’t cost too much effort, should it?

Thanks for looking into this !

Ole