Negative Condition in Email-Filter

lock
push_pin
done
Besvart
1

Hi,

We use our Support Emailadress as our Mailbox in CS then forward it to the SO Mailgun. The Forwarding works fine to create Tickets from User Requests.

And we have also Email-Filter in CS to block Auto-Reply if: 

E-mail which contains Auto-Submitted: .(auto-generated).

This Filter is to block Auto-Reply Email if Emails sennt from our Ticketsystem to any external Support Mailbox which has also Auto-Reply for acknowledgement, it could raise endless Tickets in our System. Now we see it block also the Auto-reply from SO Mailgun for acknowledgement the new registered Ticket.

How could I implement Negative in Email Filter:

if E-mail which contains Auto-Submitted: .(auto-generated).

and

Email not from @<our Domain>.suocrm.eu?

Thanks!

10. sep. 2025 | 07:11 a.m.

Alle Svar (1)

For negatives, a regular expression like

^from: (?!.*@domain\.com)

should match emails where the From field does not contain your domain.
^ indicates the beginning of a line, and might not be strictly necessary.
?! is a negative lookahead. Remember to escape periods in the domain name with a backslash.

You may want to test this with a separate filter that only adds debug information at first. 
I have used a similar filter to 'hijack' messages where our domain is not in the To field (meaning a Service mailbox is cc or bcc, and more likely to be spam) and move such messages out of the support queues.

https://www.rexegg.com/regex-quickstart.php and https://regex101.com can be useful resources for regular expressions.

11. sep. 2025 | 08:39 a.m.

Hallo Vidar,

Thanks a lot for your Solution. This regex works, but in single Condition. If i put it in the second and-Condition for Email-Subject, it doesn't work.

I want to block possible Auto-reply from external Support mailbox, but Auto-Reply from SO Mailgun for acknowledgement the new registered Ticket should come back to Sender. The Target of This filer is to avoid endless Auto-Replay in both directions.

15. sep. 2025 | 09:12 p.m.

Legg til svar