Filtering files by type and by extension
Applies to: Microsoft Antigen
You can filter files in a number of ways:
- By type, for example DOCFILE file type
- By extension, for example *.exe
- By name, for example, filename.extension
- By size, for example >5mb
This section focuses on the difference between filtering by file type and by file extension. The Microsoft Antigen for Exchange User Guide, available at the Microsoft Antigen TechNet Library, goes into detail about the other ways of filtering files, as well as how to configure all the file filtering options.
Filtering by file type
To filter file attachments by type, create a * file filter and select the file types you want filtered in the File Types section of the Administrator console. For example, create the filter * and set the File Types to MP3. This ensures that all MP3 files are filtered regardless of their file name or extension. Even if the file is renamed it will still be filtered. For example, if the file extension is renamed from .MP3 to .xyz, it will still be detected by the MP3 filter you configured.
One advantage of setting a generic * filter and associating it with a certain file type is that it reduces the chance of false positives since Antigen looks at the file header information instead of the file name. Therefore, it is recommended that you use this configuration whenever possible.
There is additional information on configuring file type filters for Office 2007 and older files in the Microsoft Antigen for Exchange User Guide.
Filtering by file extension
To filter files that have a specific extension, you can create a generic filter for the extension and set the File Types selection to All Types.
For example: Create the filter *.exe* and set the File Types selection to All Types. The second asterisk (*) will prevent files with extra characters appended after the file extension from bypassing the filter. This ensures that all files with an .exe extension are filtered.
You can also set the File Types to a specific type. However, when doing so the file extension and file type must both match for the filter to be applied correctly. If the file extension filter does not match the extension of the attached file, the specified action will not be applied regardless of the file type.
File Filter File Type Action
1) *.rtf DOCFILE Skip: detect only
2) * All Types Delete: remove contents
If you send through an attachment with a .doc extension, for example filename.doc, it will be deleted rather than skipped. The first action listed of Skip: detect only will not be applied but the second (Delete: remove contents) will be. Even though Antigen recognizes the file as a Microsoft Word document, the file extension does not match the first extension filter of *.rtf. Even if you set the first filter to All Types instead of DOC, the attached file still will not match the filter because it does not have a .rtf extension.
However, if the file extension matches, the File Type is checked to see if it too matches, and if so, the action is applied, even on renamed files.
File Filter File Type Action
1) *.doc DOCFILE Delete: remove contents
If you rename an .exe to a .doc, Antigen will not remove it. Although the file extension matches the filter, Antigen is able to determine that the file is not a valid DOCFILE file; therefore it does not match the file type you configured.
Recommended methods for configuring a file filter
In summary, the following are the recommended methods for configuring a file filter:
- Create a * file filter and select the specific File Types (for example, DOCFILE) you want filtered.
- Create a generic filter for the extension (for example, *.exe*) and set File Types to All Types.
- Create a generic filter for the extension (for example, *.exe*) and set File Types to a specific type. Note that this is the riskiest method since you must be sure of the file type and file extension when creating such a filter.
The Microsoft Antigen for Exchange User Guide, available at the Microsoft Antigen TechNet Library, describes the following additional topics related to file filtering:
- Configuring file filters based on their size.
- Creating filter lists containing multiple file filters.
- Using wildcard characters to have your filter match patterns in the file name, rather than a specific file name.
- Configuring a filter so that it checks only inbound or outbound messages.
- Filtering container files.
- Excluding the contents of a container file from being scanned for filter matches.
- Using file filtering to block some file types and permit others.
- Importing and exporting items into/from a file filter list.
- Creating a filter set template, which can contain a combination of file filters and content filters.
- Disabling file filtering for specific scan jobs.