Link to home
Start Free TrialLog in
Avatar of SmartFox
SmartFox

asked on

How to : Dispatch a mailbox rule to all users ?

Hello,


We are setting up a spam filter.

we would like to tag the uncertain spam with the tag  "[spam]" on the subject.

Then we would like it to go to the $junkmail folder.

My problem is that i would like to set up a mailbox rule on every mailbox (200 users) saying

if subject contains [spam]  move to folder $junkmail.

is there any way to dispatch or send a mailbox rule to every user ?
I'm pretty sure it is useless to  add it to the Inotes mailbox template, isn't it ?


thanks a lot
Avatar of Bozzie4
Bozzie4
Flag of Belgium image

Using mail rules, sounds pretty difficult to me.

Luckily, we still have agents.  Just create an agent in the mailtemplate, with the 'Move to folder' action on 'When new mail arrives'
Then refresh the design of all your mailfiles -- so that the agent is deployed.


cheers,

Tom
Avatar of SmartFox
SmartFox

ASKER

ok but how to say to the agent :

"if subject contains [spam]"

and

'When new mail arrives' better to use before mail arrive or after mail arrive as there is no "when" action.

thanks for helping
What definitely works, is to do it "After new mail arrives"

Put in the document selection, a simple selection , when field subject contains ***SPAM*** (i would advise not to use the square brackets, btw)

Now in the formula field, put :

@AddToFolder( "JunkMail" ; "($Inbox)" );
SELECT @All

This will move the mails AFTER they arrive.  Problem is that there will be a time lag between arriving, and automatically putting in the junkmail folder ....

Tom
ASKER CERTIFIED SOLUTION
Avatar of Bozzie4
Bozzie4
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Obviously, he doesn't need another spam filter, since there already is a product in place (that adds the [SPAM] info to the subject) ...
great job Tom , thank you so much !

i'm going to test it right now,

do you think i should use

 Call doc.PutInFolder("($JunkMail)", False )

as it is the way the folder appears in the inotes template ?
Avatar of TSO Fong
There is another way to distribute the document -- a little trick HemanthaKumar taught me a year and a half ago. (I'm surprised you haven't already suggested it, Hemanth.)

Find a database that everyone has access to. From your Rules view, select your rule and copy it (<Ctrl-C>). Paste the rule document into the database that everyone has access to. (Yes, I know that the Rule document won't have any real purpose there. We're just making it globally available.)

Find that Rule document in the database that you pasted it into. (It's helpful if you paste it somewhere that has an "all documents" view.) Get the document ID of that document, and write it down.

Create an e-mail with a button in it. Write a button script that gets the rule document by document ID from the database that everyone can access and copies it to the user's mail database, possibly sending you a notification that they've done it, if you want to track such things.

HemanthaKumar's code to distribute a customized view this way can be seen here:
https://www.experts-exchange.com/questions/20430144/Send-a-view-installer-creator.html

Hope this helps.

-- b.r.t.
thank you brice , this whould have work if we could do it without asking anything to users to do.
Experience though me that you can not even ask them to click on a button without getting tons of replying e-mails, phone calls and even users errors who make you to waste the whole day.

I'll have a look of it for sure but the agent solution, if working fine whould be much much smouther to implement.

"common sens " is not so common. ;-)

thanks a lot for your help.




have little time nowadays Tom, so no really concentrating on this forum much
I asusme you are using R6, because ($JunkMail) does not work in R5.

In that case, yes, you can .PutInFolder("($JunkMail)")
JunkMail will work too, since it is an alias for ($JunkMail)

How I wrote it, works for me on 6.5.2 (so should work on 6.5.1, 6.5, 6.0.3 and 6.0.4)

cheers,

Tom
it worked once and then not anymore.

it seem to be a timeout issue.

i got on the server console:

--> moving to folder  ---
--> removing from inbox ---
then : agent did not complete within the time limit.

should i allow the agent to make restricted actions ?

(i'm using the remote agent debugger task on the serveur wh is  6.5)

any clue about it ?







You probably keps the debug window open without allowing it to steo through to completion.  The agent effectively kept trying to run forever (but in a hold state), so eventually the agent manager kicked it out as running out of time.

How di I know this?  Because all the significant statements in the agent did run, through that last print, which indictes the agent should have simply completed.  It is running properly, just not terminating properly.  And the only reason I can see for that is because you were using the debugger.  I'm not sure why you thought you needed the debugger.
Indeed, don't use the debugger.  Just let it run (the print statements should be clear enough :-) )
The agent does not need Restricted Actions - rights, but it could be necessary to sign / save it with the server id.

cheers,
Tom
Barry,

that trick of copying a design element will probably not work for mailrules, because they need to get registered with the router task too.   Since you can already run into trouble if you (for instance) delete a mailrule without disabling it first, I really don't think that approach would work.  Can still come in handy for distributing an design element (an agent for instance :-) ) to a select group of users....

cheers,

Tom
DEAR ALL !

I Got what i needed HUm,hum, !

Indeed, it doent whork with the remote agent debugger.

The  Print "Processing " & doc.subject(0) " from " & doc.From(0)
is very good to identify in real time the deliveries, i think i will leave it as is. ;-)

this was a great job, i'm very happy.


i'll give you 500 points for the code and time spent on it.

Thanks a lot to all of you !

fred

I didn't know that, Tom. Thanks for the information!

-- b.r.t.