Custom File Expressions

File Expressions are helpful in identifying files contained in incoming email attachments. File expressions are used in File Rules which in turn are used in Spam/Virus/File Policies.  Utlimately Spam/Virus/File Policies are assigned to Internal Recipients in order to block or allow incoming email attachments on a per recipient basis.

File Expressions are created utilizing the Regular Expression (regexp) format. A good place to start and test the Regular Expression you create is the regular expressions 101 website.

For example, suppose you want to identify all Microsoft Office Word and Excel files that have the word "invoice" or the word "scan" in their filename. The Regular Expression would look like:  (invoice|scan){1,}.*(doc|xls|docx|xlsx){1,}. If you were to test the regexp at the regular expression website 101 you would see that the regexp would match on the "invoice.doc", "invoice 7892.docx" and the "scan for you.xls" files (Figure 1).

Figure 1


Regular Expressions can be confusing at first however, there are lots of resources on the Internet to help you along. A good place to start is the RegexOne website.

Add Custom File Expression

  1. In the Add Custom File Expression section, under the Enter a File Expression in the box below... field, enter the Regular Expression you wish to use.
  2. Under the Select below whether you want the file expression to be case sensitive or case insensitive either Case Insensitive or Case Sensitive. It's recommended that you always select the Case Insensitive option unless you have a specific reason not to.
  3. Under the Enter a description for your new File Expression... enter a brief description.
  4. Click the Add button (Figure 2).

Figure 2


  1. As you add Custom File Expressions, they will show up under the Delete Custom File Expressions section (Figure 3).

Figure 3


Delete Custom File Expression

Note: If a file expression is part of a file rule, the system will NOT allow you to delete it. If that's the case, the file expresion must first be removed from the file rule under Content Checks --> File Rules.

  1. Under the Delete Custom File Expressions section, select the File Expression entry you wish to delete and click the Delete button (Figure 4). Note that only one entry can be selected at a time.

Figure 4


Revision #1
Created Sat, Jan 2, 2021 2:40 PM by Dino Edwards
Updated Sun, Jan 3, 2021 12:53 PM by Dino Edwards