Preventing user forward to outside domains

Hello everyone,

We’ve been asked to investigate the prevention of mail rules automatically forwarding internal email to external addresses. We still need the ability to route mail internally, that’s why we don’t want to remove the mail rules totally.

We went the way of the mail template modification, and in the client it seems to be workable.

However, when accessing through iNotes in full mode, I’m unable to understand what is going on and where the code is residing.

Would anyone have some advice on where to look ? Is that in the mail template (doesn’t seem like it) ? I have a forms85.nsf DB as well, but there’s not so much design elements there as well.

Any answer appreciated. Thanks.

Subject: how I did it

Script Library “Rules” function “ButtonAddAction”, added below code

Call GetGlobalActionValues()



' Begin new code to restrict 'send copy to' rule to administrators ONLY

Dim ns As New NotesSession

level% = ns.CurrentDatabase.CurrentAccessLevel

If level% < 6 And ACT_sAction = "B" Then

	Msgbox " 'send copy to' actions are restricted to use by Administrators only, please choose another action.", 48, "Restricted action ..."

	Exit Sub

End If

' End new code



'// Validate some choice is selected

The above change also requires a change to the default iNotes\formsX.nsf file on ALL servers enabled for webmail access. This removes the ‘send copy to’ choice from the action list

s_RuleEditCode (form) in forms8.nsf (or forms7.nsf depending on server version), removed “send copy to |B” from below line

“move to folder|1”, “copy to folder|4”, “send copy to |B”, “set expire date|A”, “change importance to|2”, “stop processing|C”

NOTE: in Forms85.nsf the line to remove is: <dwa:string id=“L_RULES_ACT_SND_CPY_TO”/> + “|B”

The above line is about lines 18 and 19 in the code.

Subject: Thank you

That sounds very promising, I’ll have a try at that.

Initially, we wanted to prevent only forwarding to email addresses outside of our domain, so for the client it’s a little bit trickier than your solution. But we could indeed only allow mailrule creation in the client and prevent it from iNotes with your solution.