How do I restrict a check to the start or end of a line in restricted words checks?

  1. Home
  2. Knowledge Base
  3. GMS
  4. How do I restrict a check to the start or end of a line in restricted words checks?

Question

I would prefer that certain phrases in my restricted word checks only cause the rejection of an incoming message if the banned word or phrase appears at the start or end of a line and not as just a part of it. How would I do this?

Answer

We have enabled special characters in the restricted words check to refine the checks performed for that word or phrase. You may now use ^ to mark a word or phrase as only valid on a match at the start of the line. Additionally, you may use $ to mark a word or phrase as only valid on a match at the end of the line.

For example if you are a bank, a phrase such as "Foreign Currency Investing" might legitimately show up in the course of email correspondence. This is also one of a series of common spammer terms. Since this phrase usually appears at the beginning of an email, at the beginning of a new line, we can use the ^ character to restrict where in the email GMS Anti-Spam checks for this phrase.

"^Foreign Currency Investing" (Without the quotes) allows us to specify that only when this phrase appears at the beginning of a line will a message with this phrase be rejected.

Similarily, if you wish to ban blank subjects that are often used by spammers such as "Re: " or similar blank subject lines, by just adding "Re: " (without the quotes) you would match every reply to a message! However by using the end of line special character $ you can restrict the checking of this phrase so that only when it appears at the end of a line will it reject the message.

So a subject line of "Fwd: Re: " would be rejected while "Re: Our conversation" would be accepted by using the & symbol.

If you are already using restricted words such as "$$$" or "$user@your.domain.name" or similar blocks, you will want to escape the special character $ now. The characters ^ and $ can be escaped by putting them in square brackets for example [^] and [$].

Example 1:

Matching Rule: [$]user@company1.dom
Matches: $user@company1.dom anywhere in the email

Example 2:

Matching Rule: [$][$][$]
Matches: $$$ anywhere in the email

See Also:

Keywords:JUCE rwords restricted word check banned lockout stop Spam checker GMS Anti-spam anti spam antispam

Was this article helpful?

Related Articles