Can I filter in GMS for headers added by another anti-spam product

  1. Home
  2. Knowledge Base
  3. GMS
  4. Can I filter in GMS for headers added by another anti-spam product

Question

I have an anti-spam device that can add headers to messages to indicate whether they are junk email. Can I filter in GMS for these headers?

Answer

Using MML (Mail Meta Language) the built in scripting language for GMS, you can filter for headers and the content of those headers, and then either reject or move the messages to quarantine.

In the "download" link below is a sample MML script which checks a message for a header of your choosing, and then copies that message to the domain quarantine folder.

To filter for your desired header, edit the script, changing the line:

  if (wildcardmatch(emailheader,"*HEADERNAME:CONTENT*"))

to contain the header you want to filter for, and the content of that header. For example you might enter:

  if (wildcardmatch(emailheader,"*X-RBL: YES*"))

to filter for an DNS black list header.

If you want to reject the message as well as send it to the domain quarantine, you need to change the line:

  parameter = "250 received message OK";

to read:

  parameter = "550 message rejected";

Once the script contains the content you require, go to the Anti-Spam->Scripts menu, and add this as an "End of Message" script.

This script is supplied as an example to show what can be achieved, Gordano cannot directly support scripts written by customers.

The MML discussion list is a community list where others will see your post and potentially provide assistance with your code if you require it:
MML discussion list

There is also an extensive MML Programmers Guide available which is referenced below.

Downloads

  • <
  • <

Keywords:spam assassin anti-spam barracuda

Was this article helpful?

Related Articles