Autor Thema: Mail Rule - Kopie senden an  (Gelesen 6987 mal)

Offline dertoaster

  • Senior Mitglied
  • ****
  • Beiträge: 297
  • Geschlecht: Männlich
  • I love YaBB 1G - SP1!
Mail Rule - Kopie senden an
« am: 01.03.05 - 11:49:53 »
Hallo zusammen,

ein User hatte die Regel, wenn eine Mail reinkommt, sende diese an Kopie an User XY. Diese Regel hat er wieder entfernt. Trotzdem werden die Mails alle noch mal an den User geforwardet. Das geht aus dem Log hervor.

Jetzt würde ich gerne wissen, wo ich genau im Designer schauen muss, um zu sehen ob in einem Feld noch die Adresse des Users drin steht.

Habe über die DB schon ein compac -c, fixup usw. laufen lassen kein Erfolg. Eine Neue Kopie der DB habe ich noch nicht gemacht. Mich würde halt das Feld interessieren.

Wer kann mir da weiterhelfen!

Danke und Gruss
Toaster
« Letzte Änderung: 01.03.05 - 15:11:20 von dertoaster »
2x X440, SLES 8.0 Domino 6.5
2x X330, SLES 8.0 Domino 6.5
1x Compaq, W2K Server, Domino 6.5 für BlackBerry,
1x Sun Solaris Intel, Domino 5.09a
700 Clients von 5.09 - 6.5 auf WinNT, W2K, WinXP

Offline Andy B

  • Senior Mitglied
  • ****
  • Beiträge: 332
  • Geschlecht: Männlich
Re: Mail Rule - Kopie senden an
« Antwort #1 am: 01.03.05 - 12:52:00 »
Das ist ein Bug
Schau Dir einmal diese Technote an

Gruss
Andy B

Deleted Mail Rules Still Run and/or Enabled Mail Rules Do Not Runechnote (FAQ)
Problem
You may observe that a deleted mail rule continues to function, even though it no longer appears in the Rules folder. You may also observe that an enabled mail rule does not run.

Deleted Scenario #1

1. Create a Rule in a mail file. Add some conditions and actions, then click OK. (Note that the Preview Pane must not be open at this point).
2. Disable the Rule.
3. Open the Preview Pane and note that the new Rule appears.
4. Press Edit Rule on the action bar. You must edit the rule while the Preview Pane is open or you cannot recreate the problem.
5. Select "This rule is on" and click OK.
6. Click Delete Rule on the action bar.
7. The Rule is marked as deleted in the Rules folder.
8. Press F9 to delete the Rule completely.
9. Using NotesPeek or LotusScript, notice that the relative $FilterFormula_ entry still exists in the Calendar Profile document.
Deleted Scenario #2

If a Mail Rule is deleted before it is disabled, it can remain active under the following scenario:

1. Create a new rule and enable it.
2. Select the document in the Rules folder (check mark to the left).
3. Switch to another view/folder while holding down your control (CTRL) key (this leaves the rule document selected).
4. Press the Delete key while in the other view/folder.
5. Press F9 and choose Yes to delete.
6. Switch back to the Rules folder. Notice the Rule is not there.
7. Look at the Calendar Profile using NotesPeek or LotusScript and you will still see the corresponding $FilterFormula_x field present.

In cases where rules do not run under Notes 6.x, examination of the Calendar Profile document may reflect that one or more of the expected $FIlterFormula_n entries are missing.
Solution
Table of Contents

I. Disabled Rules that Still Trigger
II. Deleted Rules that Still Trigger
III. Rules that are Enabled but do not Run
IV. Workaround [for Rules that Are Deleted but Still Trigger and Rules that Are Enabled but Still Run]
V. Background Information on Mail Rule Functionality


I. Disabled Rules that Still Trigger:

This issue is common in Notes 6.x where mail templates from Notes 6.0.2 (and later 6.0.x) and 6.5x are used. This issue occurs when the Calendar 'MiniView' rule has not been configured and either a single mail rule exists and it is disabled, or multiple mail rules exist and they are all selected to be disabled. The result is that the first mail rule (with an OrderNum field value of 0) is not properly disabled - and it will continue to execute. This issue has been reported to Lotus software Quality Engineering in SPR #FBAY5UCKZR.
Workaround (to repair current issue):
1. Examine the document properties of the existing rules and be sure that the one with a field value of 0 (zero) in the OrderNum field is disabled.
2. Create and execute the following LotusScript agent
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim ff As NotesItem

Set db=session.currentdatabase
Set doc=db.getprofiledocument("CalendarProfile")
Set ff = doc.GetFirstItem("$FilterFormula_0")
Call ff.Remove

If doc.getitemvalue("Use_CalendarRule")(0) = "1" Then
doc.Use_CalendarRule = "0"
End If
Call doc.Save(True, True)
3. Re-enable the Calendar 'MiniView' rule if so desired.
Solution (to avoid in the future):
To resolve this issue, the LotusScript code within the Disable action in the "(Rules)" folder must be updated:
For Notes 6.5x and 6.0.2 and later 6.0.x:
Original code (line 23):
If Not ( Lcase( Left( items.name,16 ) ) = "$filterformula_0" ) Then '//Reseve for MiniView
Modified line:
If Not ( Lcase( Left( items.name,16 ) ) = "$filterformula_0" And profile.getitemvalue("Use_CalendarRule")(0) = "1") Then '//Reseve for MiniView
For Notes 6.0 and 6.0.1:
For 6.0.x prior to 6.0.2, either update to the 6.0.2 (or later) template and make the above correction, or replace the following area of the code as noted:

Original code (starting on line 22):
If Lcase(Left(items.name,7)) = "$filter" Then
Call items.remove()
End If
Replacement code:
If Lcase(Left(items.name,14)) = "$filterformula" Then
If Not ( Lcase( Left( items.name,16 ) ) = "$filterformula_0" And profile.getitemvalue("Use_CalendarRule")(0) = "1") Then '//Reseve for MiniView
Call items.remove()
End If
End If


II. Deleted Rules that Still Trigger:

This occurs when a rule was deleted while it was still enabled. This causes the rule entry in the Calendar Profile to not be removed. In order to avoid this issue in the future you should be sure to always disable a mail rule prior to deleting it. Ways to workaround this issue (and remove the rule entry from the Calendar Profile) are listed further below.

This issue has been reported to Lotus software Quality Engineering [as Software Problem Report (SPR) #MGAN5EDSB2]. There are currently no plans to address this issue. Note: There is a related issue where deleting a mail rule while the Preview Pane is open can cause an error (in Notes/Domino releases prior to 5.0.9). For more information on this issue refer to the document titled "Receive Error When Deleting Mail Rule While the Preview Pane is Open" (#185398 ).

Note: In some cases a rule may not have been deleted, but still run and not display in the Rules Folder.

The cause may be a duplicate "(Rules)" folders, visible only in the Designer client. To check if this is the case, open the mail database in Designer, select "Folders" to see if there are duplicate Rules folders. It is unknown why this would occur, but it may be related to unexpected behavior during the upgrade of the mail file design.

To remove the duplicate Rules folder:
1. Open the mail file from the Designer client.
2. Open the Folders design list.
3. The "(Rules)" folder with the older date should typically be the one to delete. If deleting the older folder causes issues, then repopulate the folder using the instructions directly below.

To populate the folder:
1. Create a View with the selection formula: Select Form="Mailrule".
2. Open the documents that appear in the view to determine which correspond to Rules missing from the Rules Folder. If the Rule is not within the view, do not continue with these instructions. Instead, follow the instructions in the Workaround section below.
3. Drag the document into the Rules folder.


III. Rules that Are Enabled but Do Not Run:

This issue can occur due to different logic issues in the rule enablement functionality. One issue is that newly created mail rules that are initially disabled/off do not increment a necessary rule counter field. This issue is true within mail templates in both Notes 5.x and 6.0. In Notes R5 there is an additional issue where the "Disable Rule(s)" action incorrectly sets the rules counter to a numerical value rather than the expected text value. In the Notes Domino 6.0 mail template there is an additional issue where the "Enable Rule(s)" action sets the rule counter to a value 1 less than is appropriate.
Additionally, given the numbering process used, enabled rules may not be numbered contiguously. Given that R5 will run a maximum of 50 rules per user it is possible that a rule may not trigger if its internal number is greater than 49 (the numbering starts at 0).

Relative to this issue are the following SPRs:

JCHN52B5GF: The "Disable Rule(s)" action incorrectly sets the rules counter to a numerical value rather than the expected text value.
MGAN5EDTNN: Notates an issue where the mail template code logic does not increment the rules counter for new disabled rules as well as an issue with the 6.0 mail template's "Enable Rule(s)" action incrementing to a value 1 less than expected.

Related SPR (the workaround below can be adapted to resolve this issue):
DOCY4TX7JE: Notes that Server Rules that are out of sequence will not execute. It was assumed that the issue occurred because the rules were set up on different replicas.

Noted in another document:
SBUR59GPW8: This requested that the maximum number of rules be increased. In Notes Domino 6 the maximum is now 100. For more information on this issue refer to the following document: "Is There a Limit to the Number of Mail Rules Each User Can Create?" (#182441 ).
MGAN5W4VQN: Notates various issues in the mail template code logic that does not properly check to see if the Calendar Configure button has been clicked (to enable 'MiniView' rules) and thus causes the first Mail rule and/or Block Mail rule to overwrite an existing rule. For more information on this issue, refer to the following document: "Using the Block Sender Functionality Can Internally Overwrite Previously Created Rules, as Well as Increment the Internal Rule Count too Often" (#1160706).

For Notes 6.x:

In the Rules script library, the following update should be made in the subroutines: ButtonOKClient, ButtonOKWeb and ButtonOKQuick.

Locate the following section of code and add the lines noted:

If note.isnewnote Then ' this is a new rule
' we need a new sequence number
Set viewcollection = view.allentries
If viewcollection.count = 0 Then
If profile.getitemvalue("Use_CalendarRule")(0) = "1" Then
nrulenum=1
Else
nrulenum=0
End If
Else

For Notes 6.5x:

In the BlockUserRule script library in the Declarations section update the FindHighestRule function as follows:

If Highest=0 Then 'Remove this line and replace with below:
If Me.m_CalProfile.Use_CalendarRule(0)="1" Then
Highest = Highest + 1
End If
FindHighestRule = Highest
End Function


IV. Workaround [for Deleted Rules that Still Trigger and Rules that Are Enabled But Do Not Run]

These issues can be worked around using the following steps:
Select all of the mail rules that are not enabled and click the "Enable Rule(s)" action.
Note: If there are no rules displaying in the view then create one.
Click the "Disable Rule(s)" action.
Determine if the Rules OrderNum field values have gaps. (If so, they will need to be re-ordered.)
In order to determine a field's OrderNum value, right-click the document, select the second tab, and find the OrderNum field in the list. The value will be in the right pane.
In R5, the first rule should be 0, the second 1, etc. If there are any gaps, they will need to be programmatically renumbered.
In 6.x, the first rule sometimes starts with 0 and sometimes starts with 1, all the following Rules should follow in sequence and will need to be programmatically renumbered if they do not. In 6.x Server Rules, the first rule starts with 0.
If the OrderNum field values do not have gaps, enable the rules that you want to be active, or as necessary delete the 'dummy' rule created in the first step. No other steps are needed at this time.
If the OrderNum field values have gaps, proceed below to the Agent for Re-Ordering the Rules.
Agent for Re-Ordering the Rules:
With all of the Rules enabled and then disabled, the following agent can be run to re-order the OrderNum field of the Rules. The agent should be created as a Run Once agent in the mail file:
NOTE: The below example is designed to resolve Rules issues where the order number is affecting the execution of the Rule. Lotus Support is not available to make further modifications or enhancements to the code.
Dim s As New notessession
Dim db As notesdatabase
Dim rulesfolder As notesview
Dim rules As notesviewentrycollection
Dim rule As notesviewentry
Dim ruledoc As notesdocument

Set db=s.currentdatabase
Set rulesfolder=db.getview("Rules") 'If renumbering Server Rules then change the GetView parameter to "(Server Mail Rules)"
Set rules=rulesfolder.allentries

Set profile=db.GetProfileDocument("CalendarProfile")

'Optional code for User Rules to remove rule entries from the Calendar Profile which did not disable as expected.
'Note: A specific workaround and code fix for a Notes 6.x issue is noted above in the section titled "Disabled Rules that Still Trigger"
'The code below must be used if you want to simply "clean out" the rule entirely in the profile.
'Note: The code below will disable the C&S Miniview rule - so it must be manually re-enabled.

'If profile.getitemvalue("Use_CalendarRule")(0) = "1" Then
' profile.Use_CalendarRule = "0"
'End If
'Set Count=profile.getfirstitem("$FilterFormulaCount")
'Call count.remove
'Forall ff In profile.Items
' If ff.type = 1536 And Lcase(Left(ff.name,15)) = "$filterformula_" Then
' Call ff.remove
' End If
'End Forall
'Call profile.Save(True, True)

If profile.getitemvalue("Use_CalendarRule")(0) = "1" Then
number=1
Else
number=0
End If
Set rule=rules.getfirstentry
While Not rule Is Nothing
Set ruledoc=rule.document
ruledoc.ordernum=Cstr(number)
Call ruledoc.save(True, True)
Set rule=rules.getnextentry(rule)
number=number+1
Wend


NOTE: While the agent above is the recommended procedure by Notes Support for handling the issues noted, if a more straight-forward agent is desired, the following approach could be used. However, the use of the agent below results in the complete deletion of the Calendar Profile document. This document is used to save all of the user's settings found under Tools -> Preferences, such as Calendar free time, Alarms, Mail delegation, Calendar delegation, etc. All of these settings will need to be reset by the user manually through the user interface. It is suggested that users review their current settings under Tools -> Preferences and note the settings prior to executing the LotusScript code below.

The following agent gets a handle to the current user's mail file and deletes the Calendar Profile:

The agent should be set up as a Run Once agent in Notes 5.x, and to run on 'None' in Notes 6.x.
Dim session As New NotesSession
Dim db as NotesDatabase
Dim doc As NotesDocument
maildbinfo = Evaluate(|@MailDbName|)
Set db = session.getdatabase(maildbinfo(0), maildbinfo(1))
Set doc = db.getprofiledocument("CalendarProfile")
Call doc.remove(true)


To Avoid These Issues in the Future:
Prior to deleting a rule always disable it first.
When creating a rule, always have it enabled/on. If you do not want the Rule enabled, highlight it in the folder and click the "Disable Rule(s)" button.
If using Notes 6.0.x or 6.5.x, make the corrections noted above in the sections "Rules that Are Enabled but Do Not Run" and "Disabled Rules that Still Trigger".

An enhancement request has been submitted to Lotus software Quality Engineering in SPR #RWAS547K42, which requests that additional functionality be added to reorder the internal numbering used for Rules. There are currently no plans to address this issue in Notes 5.x or Notes 6.x.


V. Background on Mail Rule Functionality:

When a mail rule is enabled, a $FilterFormula_# field is added to the Calendar Profile, where x equals the number of the rule in the list starting at 0. For example, if you have 3 rules in your Rules folder, and the 1st and 3rd rules in the list are enabled, the Calendar Profile will have $FilterFormula_0 and $FilterFormula_2. This field will have a formula that matches the condition of your rule and is used to perform the rule action when mail is deposited. When a rule is disabled, we remove the corresponding $FilterFormula_# field from the Calendar Profile. Note: The fact that the $FilterFormula_# field is not deleted when a mail rule is deleted prior to being disabled is the SPR issue discussed above. By design, the $FilterFormula_# entries are not renumbered when a rule is disabled or deleted.

The Calendar Profile also contains a field $FilterFormulaCount that should coincide with the total number of Rules within the mail file. The $FilterFormulaCount should always be at least one value higher than the highest $FilterFormula_# entry -- otherwise the rules that fall numerically above $FilterFormulaCount-1 will not run. For example if $FilterFormulaCount is 4, no $FilterFormula entries above $FilterFormula_3 will be executed. The reason for the offset by 1 is because the $FilterFormulaCount has a starting value of 1 and the $FilterFormula_# entries have a starting value of 0.

Note: In Notes 6.x, the numbering can be slightly different depending on whether the Calendar & Scheduling "Configure" button has been executed. When you click the C&S "Configure" button, an additional rule is created and is written to $FilterFormula_0 and any previously existing rules are re-written to a $FilterFormula_# entry 1 value higher. For example, $FilterFormula_0 is shifted to $FilterFormula_1, and $FilterFormula_1 is shifted to $FilterFormula_2, etc. The $FilterFormulaCount value is also incremented by 1. So, in the case where a user has clicked the C&S "Configure" button, the $FilterFormulaCount value will be equal to the number of user rules plus 1.


Example LotusScript to get a handle to the Calendar Profile document:

You can create a LotusScript agent or button with the following code in order to get a handle to the Calendar Profile. If you enable the LotusScript Debugger (Files, Tools, Debug LotusScript), you can step through the code and expand the DOC object, and then the ITEMS array in order to view the $FilterFormula_# fields and the #FilterFormulaCount field.

Dim session As New NotesSession
Dim db as NotesDatabase
Dim doc As NotesDocument
maildbinfo = Evaluate(|@MailDbName|)
Set db = session.getdatabase(maildbinfo(0), maildbinfo(1))
Set doc = db.getprofiledocument("CalendarProfile")


Related Documents:

Receive Error When Deleting Mail Rule While the Preview Pane is Open
Document #: 1084301

Is There a Limit to the Number of Mail Rules Each User Can Create?
Document #: 1091326

Notes Mail Rule Is Not Disabled Immediately in Notes 5.x
Document #: 1099458

Using the Block Sender Functionality Can Internally Overwrite Previously Created Rules, as Well as Increment the Internal Rule Count too Often
Document #: 1160706

Offline dertoaster

  • Senior Mitglied
  • ****
  • Beiträge: 297
  • Geschlecht: Männlich
  • I love YaBB 1G - SP1!
Re: Mail Rule - Kopie senden an
« Antwort #2 am: 01.03.05 - 15:10:28 »
Danke Andy!!!

Genau das war es, was ich gesucht habe!   ;D

Gruss
Toaster
2x X440, SLES 8.0 Domino 6.5
2x X330, SLES 8.0 Domino 6.5
1x Compaq, W2K Server, Domino 6.5 für BlackBerry,
1x Sun Solaris Intel, Domino 5.09a
700 Clients von 5.09 - 6.5 auf WinNT, W2K, WinXP

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz