Jump to content


Photo

Regex header rule is not working

regex rule filter troubleshooting headers header filter content filter

Best Answer Jaybone, 07 May 2018 - 03:35 PM

Looks like you're trying to use a "!" as an negator?  AFAIK, that's not supported.

Go to the full post


  • Please log in to reply
4 replies to this topic

#1 Andrea Dominguez

Andrea Dominguez
  • Members
  • 3 posts

Posted 07 May 2018 - 02:03 PM

I tested this regex extensively and it is not working. The use case is as follows: we want to quarantine any emails that have our CEO's name as the sender but that don't come from one of our domains. I created this regex to comb through the email headers and quarantine any emails that match.

 

Regex:

 

From: \b(John Doe|J. Doe|John D.) <.*@(?!(domain1|domain2)).*>

 

I tested it by sending emails from a gmail account with the name "John Doe". It should've been quarantined but it made it through to my inbox. Any ideas on what the issue might be? 



#2 Jaybone

Jaybone
  • Members
  • 114 posts

Posted 07 May 2018 - 03:35 PM   Best Answer

Looks like you're trying to use a "!" as an negator?  AFAIK, that's not supported.



#3 Andrea Dominguez

Andrea Dominguez
  • Members
  • 3 posts

Posted 07 May 2018 - 04:21 PM

 

Posted Today, 04:35 PM

Looks like you're trying to use a "!" as an negator?  AFAIK, that's not supported.

 

That would explain it if that's the case. I read in the Barracuda guidelines on this and it only said that it was case insensitive, so \W would become \w. I did not see anything about ! as negator not being supported.

 

If it's a "feature" and not a bug - do you have any suggestions as to how I can make this filter work?

 

Thank you. -Andrea



#4 Andrea Dominguez

Andrea Dominguez
  • Members
  • 3 posts

Posted 07 May 2018 - 04:22 PM

Looks like you're trying to use a "!" as an negator?  AFAIK, that's not supported.

 

Thanks, That would explain it if that's the case. I read in the Barracuda guidelines on this and it only said that it was case insensitive, so \W would become \w. I did not see anything about ! as negator not being supported.

 

If it's a "feature" and not a bug - do you have any suggestions as to how I can make this filter work?

 

Link to the guide I used:

https://campus.barra...-spam-firewall/



#5 Jaybone

Jaybone
  • Members
  • 114 posts

Posted 08 May 2018 - 01:51 PM

I'm going based on the help page on the device itself:

 

"Special characters include:  .   [   ]   \   *   ?   $   (   )   |   ^   @"

 

The ! character actually doesn't show up anywhere on the help page at all.

 

No idea how to work around it, unfortunately.