• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

Prevent sending of 1KB pdf files

One of my departments uses some software that emails out pdf attachments
Occasionally a fault may occur with the software which results in blank pdf files being sent.

Fairly embarrassing when this happens, usually we don't notice until a recipients contacts us querying why the pdf is blank

Is it possible with Exchange 2010 to create a rule that will stop an emails from being sent if it contains a pdf that is 1KB OR SMALLER?
1 Solution
mcsweenSr. Network AdministratorCommented:
I'm looking at Exchange 2013 but I'd configure the rule using an exception like this:

Apply this rule if
-Any attachment's file extension matches - PDF
Do the following
-Block the message - Reject with reason
Except if any attahment's size is
-Any attachment size is greater than or equal to - 2KB
New-TransportRule 'Block Empty PDFs' -AttachmentExtensionMatchesWords 'pdf' -ExceptIfAttachmentSizeOver '2 KB' -RejectMessageEnhancedStatusCode '5.7.1' -RejectMessageReasonText "You Tried to Send an Empty PDF"

Open in new window

This won't catch them if the message has more than one attachment though.  If there is always 1 attachment per message this will work.
Zacharia KurianCommented:
why can't you configure the "software" not to create a blank page?

have tired creating such rule in outlook?
antoniokingAuthor Commented:
Thank you mcsween
Your code worked, allthough switch -AttachmentExtensionMatchesWords is not recognised in Exchange 2010 so I replaced this with
-AttachmentNameMatchesPatterns ' *.pdf'

Open in new window


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now