Whenever a message is sent or received, a certain method (or function) in your plug-in code will be called, passing you the name of a file which contains the message in its entirety in MIME format. You may do anything within this function, including deleting this file, moving it to another user, or mailing it externally. What you return from this function determines whether or not WorkgroupMail sends the message to the message quarantine. When your plug-in is imported into the WorkgroupMail administrator, it will be visible as an entry in the left-hand list. When a user double clicks on the plug-in entry, another function will be called in your program, enabling you to show whatever user interface you wish. This may be anything from a message box, to a multi-page property sheet to an entire application. Getting Started Once you have downloaded the sample, load it into Visual Basic. You will see four functions defined. These are described in the next section: The Programmatic
Interface EditProperties() This function is called whenever the plug-in entry is double clicked in the WorkgroupMail administrator or the Properties context menu of the plug-in entry is selected. This function takes no arguments and returns nothing back to the caller. Ideally, this function should create a modal dialog box or property sheet, allowing the user to change any settings associated with the plug-in. DefaultName() This function is called by the WorkgroupMail Administrator in order to query the name of the plug-in. The plug-in name will be used to display the plug-in in the left hand window in the WorkgroupMail Administrator. So, for example, you might return a typical DefaultName string as follows: DefaultName = "Sample Plug-in" GetProperties() This function is used to display the properties (or settings) associated with the plug-in, in the right hand window of the WorkgroupMail Administrator when the user clicks on the plug-in entry in the left-hand window. The string that you return from this function represents all the properties and values of the plug-in. The format of the string is as follows: Property 1 & Value 1 & Property 2 & Value 2. So, for example, you might return a typical property string as follows: GetProperties = "Name&Sample Plug-in&Folder&" & "c:\temp" & "&Date&" & "12/4/01"
ProcessMessageFile() This function is called by the WorkgroupMail engine to determine whether or not a particular message should be quarantined. The ProcessMessageFile() should do the following:
Importing
the Plug-in
|