I Need To Make A Change With My IT Support! Call (225) 706-8414

Block Email Attachment Types Using Microsoft Exchange 2010 Transport Rules

You want to block incoming attachment types in Microsoft Exchange 2010.

Solution

There are many reasons one may want to block specific file types from getting onto their email server. There are also many ways to complete this task. If you’re running Exchange in a box – one server for CAS, Transport and Mailbox – perhaps the easiest way to pull this off is to use Transport Rules.

In this example we’ll block Attachments containing .zip files.

First, we’ll setup a rule via Exchange Management Console:

  1. Launch the Exchange Management Console, Expand the Organization Configuration tree, Select Hub Transport and Click New Transport Rule… in the Actions pane.
  2. Give the rule a descriptive name, comment if you like, and click Next
  3. Now you’ll see all of the conditions that can be applied to incoming email, for Step 1: scroll down the list until you reach: when any attachment file name matches text patterns 

    There should now be an entry in Step 2:. Click text patterns 

  4. You define the match that Exchange will look for when a new email comes in via the Text patterns: field. Since we’re presently only trying to block .zip files, leave out the quotes and enter the following string: ” *.zip”   BE AWARE of the leading space in that string, it must be in there.
  5. Click OK and Click Next
  6. Now that we’ve defined what Exchange is looking for, we need to tell Exchange what to do once the rule has a match. In my test case, I will just simply tell Exchange to Delete the message without notifying anyone, which is the last option. Click Next once you selected the Action that will be taken.
  7. The third and final configuration window is exceptions. The rule to this point is extremely broad, this is where you can allow that one user in accounting to receive .zip files. There are a lot of options here, when you’ve finished making exceptions or don’t need any,  click Next.
  8. Click New and Click Finish

Here’s the same rule via Exchange Shell:

  1. From the Exchange Shell, paste the following command:
    New-TransportRule -Name 'Block All .ZIP Attachments' -Priority '0' -Enabled $true -AttachmentNameMatchesPatterns ' *.zip' -DeleteMessage $true

Concerned About Cyber Attacks?

CLICK HERE >

Want to Migrate to the Cloud?

CLICK HERE >
Office 365

Ready to Experience Microsoft Office 365?

Want the latest IT news directly in your inbox? Subscribe now!