We have a departmental public folders and a sink script that informs
all the users in that department when there is a new message in the
public folder. The script that is triggered when a new mail
notification come through looks like this:
Sub ExStoreEvents_OnSave(pEventInfo, bstrURLItem, lFlags)
Dim aBRL, aUser
Dim i
Dim oShell
Dim sMBox, sMessage
Call LogEvent("ExStoreEvents_OnSave","Begin")
' a new item has been saved in a public folder, so send out an alert
to all
' administrators and ISCs at this location
' parse the url to find out what mailbox/folder caused the event
aBRL = Split(bstrURLItem,"/")
sMBox = aURL(UBound(aURL)-1)
Call LogEvent("ExStoreEvents_OnSave","PFolder=" & sMBox)
Call LogEvent("ExStoreEvents_OnSave","Message=" & aURL(UBound(aURL)))
' grab the array of users
aUser = RetrieveUsersForMBox(sMBox)
' create a command shell to send the net send
Set oShell = CreateObject("WScript.Shell")
If IsArray(aUser) Then
' an array of users was passed back, so net send them that they have
mail
sMessage = Replace(S_MAIL_ALERT,"<MBox>",sMBox)
sMessage = Replace(sMessage,"<vbCR>",vbCR)
For i = 0 To UBound(aUser)
'WScript.Echo("net send " & aUser(i) & ": " & sMessage)
Call oShell.Run("net send " & aUser(i) & " " & sMessage)
Call LogEvent("ExStoreEvents_OnSave","Notify=" & aUser(i))
Next
Else
' no user is set up for this location, so net send to the sys admin
sMessage = Replace(S_MAIL_NO_ADMIN,"<MBox>",sMBox)
sMessage = Replace(sMessage,"<vbCR>",vbCR)
Call oShell.Run("net send " & S_ADMIN_ALERT_USER & " " & sMessage)
Call LogEvent("ExStoreEvents_OnSave","NoUsers:Notify=" &
S_ADMIN_ALERT_USER)
End If
Set oShell = Nothing
Call LogEvent("ExStoreEvents_OnSave","End")
Call LogEvent("","")
End Sub
Lately I have noticed that the aforementioned script gets triggered all
the time without any new email message in the public folder. Its
driving all of us users crazy...Pleeeeeeeeeeeeeeeease help!!!!!!!!!!!!!1
Henning Krause - 19 Sep 2006 21:44 GMT
Hello,
the OnSave event is triggered if any changes are made to an item.
You should filter to those events where the EVT_IS_DELIVERED (value is 8)
flag is set in the lFlags parameter. Or at least EVT_NEW_ITEM (value is 1).
Best regards,
Henning Krause
----------------------------------------------------------------------------
Visit my website: http://www.infinitec.de
Exchange access library -
http://www.infinitec.de/software/nettoolbox/infinitec.exchange.aspx
> We have a departmental public folders and a sink script that informs
> all the users in that department when there is a new message in the
[quoted text clipped - 53 lines]
> the time without any new email message in the public folder. Its
> driving all of us users crazy...Pleeeeeeeeeeeeeeeease help!!!!!!!!!!!!!1