|
Re: Stop the smtp service on an Exchange 2007 server?
> What I have in mind is something like this:
>
> Make a powershell script that parses the logfile at intervals, and if it
> finds an smtp code 421 from hotmail, it will simply stop the smtp service on
> the server, I know that this means that mail to all other domains will be
> stopped also, but stopping mail to hotmail is top priority in this process,
> so a solution where the script stops the outgoing queue or enables a filter
> to stop outgoing mail to hotmail would be better but I dont know if thats
> easier/possible.
OK, I don't know where the SMTP code gets stored (get-eventlog,
get-messagetrackinglog)?
I did try this (formatting broken):
set-TransportRule -Name 'hotmail' -Comments '' -Conditions
'Microsoft.Exchange.MessagingPolicies.Rules.Tasks.SentToScopePredicate','Microsoft.Exchange.MessagingPolicies.Rules.Tasks.HeaderContainsPredicate'
-Actions
'Microsoft.Exchange.MessagingPolicies.Rules.Tasks.RejectMessageAction'
-Exceptions -Identity 'hotmail'
What this does is if I try to send something to an address that has
"hotmail" in the to field (might need to make it more specifice like
@hotmail.com), the message is rejected and a bounce back occurs.
That's 1/2 of the solution...
I love PowerShell!
Marco |