Bounce emails from unknown domains

Infos:

  • Used Zammad version: 6.5.0-1754550980.0afb9444.noble
  • Used Zammad installation type: Package
  • Operating system: Ubuntu 24.04
  • Browser + version: Chrome 142.0.7444.163 on Win11 pro 24H2

Expected behavior:

I want to create a filter / rule that checks the domain name of any incoming emails and if the domain does not match to any customer then the email should be bounced back to the sender with a “sorry you can’t create a ticket, if you think this is an error then please contact us by alternative means and we can get you setup”

Actual behavior:

I don’t know if the above is possible.

I have looked at Channels → email → filter. I think match all of the following “From” “is none of” is a good start but I don’t know what to put in the next box to match all existing customer domains. I also can’t work out what action would be appropriate here to send an email. Assuming that this is not the correct place.

Also looked at Manage → Trigger and thought a Selective, State is new organisation is not not set, execute state “closed”, email “you can’t create tickets… etc” might work but I thought it was sensible to seek advice before I break things…

Does anyone have any advice / pointers / suggestions please.

PS…

If it was possible to prevent the email address from showing up as a user then that would also be super handy.

First off, your installation isn’t up to date - you should fix that sometime soon, especially if it’s accessible externally.

Secondly, I think you’re best of by creating this rule directly on your mail server. Why? Because you can add domains you trust to your contacts and use them for an explicit rule, declining all unknown senders.

1 Like

Thanks for the heads up on the updates. If only there was a way to schedule a ticket that reminded me to update Zammad…

Interesting idea to use the mail server, it’s not an ideal situation as I would prefer to manage the domain “allow” list in Zammad. At the moment it’s only me using this so not a problem but I don’t really want to give other help desk people access to depths of the mail server to do this. That said, it does route through a M365 mailbox so I could add the rule there. Still not ideal giving people access to that mailbox (don’t want them to eff around in the mailbox) but it would work.

Will have a play with that.

If anyone can think of a sensible way to do it in Zammad then I would be grateful of the suggestions

Maybe you can build on this: Only Allow Request from Certain Domains - #3 by H0FF3R

Thanks @banya,

I think that would be close, I don’t see a way to send a reply from the email filter bit and I need to work out how to make the “your domain here” be some sort of variable array that contains the domains of all customers.

It looks increasingly like this is not actually possible which is a shame.

My past experiece with other ticketing systems like osTicket, also would just ‘drop’ the email and not send a response. So maybe it would indeed be better to create whitelists in your mail provider, filter there, and forward the mail to the ticketing mailbox if the filter matches?

Why not use a trigger to qualify and if the user should gtfo then drop the mail after replying?
Banya however is right, using the MTA level is much better. Zammad will always create a new customer user for unknown senders. There’s nothing like “deny unknown users” in Zammads core - that’s the way it’s intended to be.

Another side note, especially with all the spam backslash with recent google mailing lists and co. If you blindly reply to everything you get (and this is assuming spam a lot here), you might get yourself on blocklists too or at least you confirm your existence to the sender.

Not sure why you want to do this to be honest. Because blocking potentially legitimate mail from a potential customer (I’m just fishing in the dark here…) might also not get you a sale.