You are hereBlog
Register   |  Login
 Blog_List
 Sponsored Links
 View_Blog
May 11

Written by: SUF
5/11/2009 3:10 PM 

A few days ago I've got a question:

How can I block the messages with empty from address in the Exchange 2007.

The trivial answer is:

By using the Sender Filter Agent on the Edge Transport can block the empty senders.

But...

Stop here for a moment. It will block the messages with empty address in the MAIL FROM: smtp command. What will happen with the messages what has no From: address in the message header. The Sender Filter will not even know about these messages because it just examines the smtp communication not the message contents.

The solution:

We are able to write a Transport Rule (running on the Edge or the Hub Transport) what able to block such message:

$Condition = Get-TransportRulePredicate FromScope
$Condition.Scope = 'NotInOrganization'
$Exception = Get-TransportRulePredicate FromAddressMatches
$Exception.Patterns = @("@")
$Action = Get-TransportRuleAction DeleteMessage
New-TransportRule -Name "Remove message with empty from address" -Conditions $Condition -Exception $Exception -Actions $Action

You may realize that I used a single @ to determine the empty sender. You can change it to real e-mail regex pattern if you want to validate the e-mail address format. In that case all messages with not valid format sender will be dropped.

Tags:
 Blog_Archive
 Search_Blog
 PayPal