-
Topic
-
We have the requirement to create a standard rule in users mailboxes. This rule is to be set up to forward emails to a particular user if they meet certain criteria. We would like to forward the mails if the mail is from ‘Admin User’ or the mail contains ‘FAX’ in the from address and the subject contains ‘Received from’. The code I am using is below:
Sub Main(Client, GWEvent)
Dim hFilter
hFilter = GroupWise.FilterCreate(fttInbox, TRUE)
call GroupWise.FilterSetText(hFilter, fldFrom, “Admin User”, matSubtext, “”, “”)
call GroupWise.FilterGroupMarker(hFilter, bopOr)
call GroupWise.FilterGroupBegin(hFilter, bopAnd)call GroupWise.FilterSetText(hFilter, fldFrom, “FAX”, matSubtext, “”, “”)
call GroupWise.FilterSetText(hFilter, fldSubject, “Received From”, matSubtext, “”, “”)call GroupWise.FilterGroupEnd(hFilter)
Call GroupWise.RuleCreate(“”, “TEST”, racNewItem, “”, hFilter, btoDontCare)
Call GroupWise.RuleAddActionForward(“”,”TEST”,”gwadmin”,””,””,”Forwarded by Fax Rule”,””,””,””)
End Sub
This will create a rule called ‘TEST’ with what looks like the correct logic. However, when emails are received with the correct settings they are not forwarded.
If I edit the Filters to only include the From ‘Admin USer’ section then it will work and the same for the other section. It is only when they are both put together that the probelm arises.
Any thoughts on where I am going wrong? Any help would be greatly appreciated.
- You must be logged in to reply to this topic.