Archive for Exchange
Sending backup tape reminder e-mails
Posted by: | CommentsThis is just a very quick script written in response to a question posted in one of the SBS yahoo groups.
It sends an e-mail to a specified recipient reminding them to change the backup tape in a server. The SBS backup system does this automatically, so this is meant for use on SBS servers using something other than the in-built SBS backup.
Installation is simply a case of extracting the contents of this zip file to a folder on your SBS server and then changing the variables at the top of the script to appropriate values for your environment.
Once done you can test interactively from a command line by running “cscript tapereminder.vbs” and once you are happy with the results setup a scheduled task to do the job daily.
The ISMTPOnArrival_OnArrival event sink in Exchange 2003 can be used to trigger code to perform various tasks. I have recently used this method to strip attachments from messages and then FTP them to a remote machine, based on the message subject and recipient.
In this, more basic example the entire message is saved to the filesystem in .eml format to a folder specified within a variable. The script could be made much more elaborate with the addition of a couple of arrays to specify multiple subjects/locations. The idea is that you could setup a system where e-mails can be automatically filed without having to depend on user intevention and avoiding the requirement for 3rd party software.
This can be implemented by following the example from this Microsoft Knowlegbase article. The file referred to in the article called SMTPREG.VBS can be found here on MSDN. Instead of the SMTPMsgCheck.vbs file referenced in the article create a file called SMTPSubjectCheck.vbs and insert the following code(you will also need to modify the registration batch file accordingly) :
<SCRIPT LANGUAGE="VBScript">
Sub IEventIsCacheable_IsCacheable()
'To implement the interface, and return S_OK implicitly
End Sub
Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus )
Dim Pos, SubjectToFind, SaveFolder, MsgStream
SubjectToFind="Project1"
SaveFolder="c:\\"
Pos=InStr(1,Msg.Subject,SubjectToFind,1)
if Pos <> 0 then
set MSGStream= Msg.Getstream
SaveFile=SaveFolder & Msg.Senton & "-" & msg.subject & ".eml"
SaveFile=Replace(SaveFile, "/", "_")
SaveFile=Replace(SaveFile, " ", "_")
SaveFile=Replace(SaveFile, ":", "_",3)
MsgStream.SaveToFile savefile,2
MsgStream.Close
Set MsgStream = Nothing
End if
End Sub
</SCRIPT>
In this example the script is looking for a subject line that contains the text “project1″(not case sensitive) and saving it to the root of c:
I have attached a zip file to the blog post with all the required files in one zip file, just be cautious of using it if you already have event sinks registered(drop the files into c:\eventsink).
subjectcheck.zip
Exchange 2003 SP2 IMF Keyword Manager
Posted by: | CommentsExchange 2003 sp2 comes with an updated intelligent message filter. One of the new features of the updated IMF is the ability to add a custom weighting file that gives administrators more control over incoming mail.
I have used this file a few times on customers systems, usually to allow certain automated e-mails through the IMF which were being incorrectly identified as spam.
The problem is that Microsoft have not included a GUI to edit the MSExchange.UceContentFilter.xml file. ?Ǭ�So it must be generated by hand, and while this isn’t difficult, it is not very convenient and it is easy to make a mistake.
I was looking for an excuse to have a play with Visual Basic 2005 and so I have made a little utility to make creating and managing the MSExchange.UceContentFilter.xml a little easier.

Becomes….

The utility can be downloaded from here.(Requires .net 2.0).
If you need more information on how to implement the custom weighting feature then see:
Microsoft Exchange Server 2003 Service Pack 2 Release Notes
Microsoft Exchange Server Intelligent Message Filter v2 Operations Guide