• Rules logic (OL2002 SP2)

    Author
    Topic
    #391454

    Is there any way to use If-Then-Else logic in an Outlook rule? For instance, I want to query a value in the header of all emails that has a numeric value. If it is greater than some value, I want to immediately delete it.

    Viewing 2 reply threads
    Author
    Replies
    • #699393

      You want something like

      If Spam Score > 51 Then Delete Message?

      I don’t think this is an option through the Rules Wizard, which basically offers simple string matching in the message header. Depending on the range of values, you could look for a number of strings that would attempt to accomplish most of the same thing. Not the most efficient approach.

      You could try a Visual Basic for Applications (VBA) solution. To read the message header using VBA requires an extended MAPI library such as Redemption, because Outlook doesn’t normally give you access to the message headers using Outlook’s built-in programming model. Unless someone’s already built this, it seems like a lot of work.

      If you give us a little more background on the header info maybe you will get some more promising suggestions. smile

      • #699400

        This is what the field looks like:

        X-Text-Classification: K9spam [97.7%]

        Obviously the 97.7% number can vary.

        This is from a spam trap program that I have been having very good success with K9 (http://keir.net/k9.html). It’s free/donateware. It only works with POP3 email servers and is Bayesian based.

        I get around 100+ emails a day and most of them are spam. K9, as you can see below, is catching 98.5% of the spam. Actually, the number is over 99% recently (the 98.5% number is averaged over a longer time period). Compared to the last spam program I used, this requires almost no maintenance or tweaking. I have setup a whitelist and my blacklist has all of 2 rules.

        K9 forwards all emails to Outlook. I use a rule looking for the header field above and route the spam to a folder. But all I do then is go to the folder, Ctrl-A to select them all and then delete them all. But since Robin at K9 just added the % spam statistic, I thought I might be able to automate a bit and maybe auto delete anything with say , a figure over 90%. And also maybe route something with a lower spam % value to another folder (though K9 is rarely wrong).

        —————————————————

        Since 5/26/2003 12:00:00 AM
        Total number of emails processed 7,472
        Number of Good emails processed 1138
        Number of Spam emails processed 6,334
        Percentage of emails that matched whitelist rules 10.1%
        Percentage of emails that matched blacklist rules 0.4%
        Number of emails re-classified to Good 4
        Number of emails re-classified to Spam 173
        Percentage emails misidentified as Spam (false positives) 0.1%
        Percentage emails misidentified as Good (false negatives) 2.3%
        Overall accuracy 97.6%

        Since 7/4/2003 12:09:18 AM
        Total number of emails processed 3,471
        Number of Good emails processed 462
        Number of Spam emails processed 3,009
        Percentage of emails that matched whitelist rules 8.8%
        Percentage of emails that matched blacklist rules 0.8%
        Number of emails re-classified to Good 3
        Number of emails re-classified to Spam 50
        Percentage emails misidentified as Spam (false positives) 0.1%
        Percentage emails misidentified as Good (false negatives) 1.4%
        Overall accuracy 98.5%

        • #699405

          Try a match on K9spam [9 in the message header and see if that works.

          • #699411

            Hmmm. Interesting idea….

          • #699689

            OK, that works. Too bad MS didn’t see fit to add some IF logic to the rules base. It seems the only way to get any more granularity would be to make a whole series of rules for each percentile. Thanks!

            • #699721

              I tried to create a rule that would permanently delete a message (if it was rated at 100% likely hood of spam). This will happen when one of my blacklist rules are hit in K9. Mother Microsoft won’t let me do a permanent delete for some reason unless I stop processing more rules. Hmph! Where’s the logic in this restriction?

              Apply to message
              with “X-Text-Classification: K9spam [100” in the message header
              permanently delete it
              and stop processing more rules

            • #699724

              Well, “stop processing” means “for this message.” If you didn’t stop after deleting, Outlook would crash trying to apply a rule to a nonexistent message. Unless I’m missing something, like a condition that would cause you to want to “undelete” it. grin

            • #699748

              OK, I’ll try it. I thought it meant no more messages would be processed. I did some searching and finally found this reference on the MS website (didn’t find anything in the Outlook help file):

              “To avoid multiple rules operating on the same message, especially if you don’t want the bottom-most rule to prevail when multiple rules apply, select stop processing more rules as an action”.

            • #700105

              Everything working OK now…

            • #700895

              Well, almost working OK.

              This rule:
              Apply to message
              with “X-Text-Classification: K9spam [100” in the message header
              permanently delete it
              and stop processing more rules

              occasionally generates the following error messge

              Rules in error
              X-Text-Classification: K9spam [100 You don’t have appropriate permission to perform this operation.

              When this error occurs, the rule is turned off and the error message sticks on my screen. Most of the time it works without issue. Any idea why this error is occuring and what to do about it?

            • #700902

              When the error message comes up, are you logged onto your machine with Administrator rights? HTH

            • #700984

              “When the error message comes up, are you logged onto your machine with Administrator rights? HTH”

              Yup. I’m always on as admin in admin mode.

              btw: Is there a quote function somewhere around here that I am missing?

            • #700991

              You asked[indent]


              Is there a quote function somewhere around here that I am missing?


              [/indent]Yes, put

              before and

              after the text to be quoted. You can also insert the tag pair from the 1-Click TagPanel by clicking QUO, then paste or type the text to be quoted between the tags. See Help 19

            • #701035

              [indent]


              You asked

              ——————————————————————————–
              Is there a quote function somewhere around here that I am missing?
              ——————————————————————————–

              Yes, put

              before and


              [/indent] after the text to be quoted. You can also insert the tag pair from the 1-Click TagPanel by clicking QUO, then paste or type the text to be quoted between the tags. See Help 19

              I’m trying this now. So you still have to manually copy the text first? Sure would be easier if there were a simple QUOTE button to click like in Innvision Power Board forum software. Could a button be added to this software?

            • #701037

              Questions and suggestions about the Lounge software can be posted in the Lounge Matters forum.

              I don’t know if the Lounge Administrators would welcome the possibility to quote an entire post with one click. Some posts are pretty long, and there is little sense in quoting them in their entirety. Quoting the relevant sentence(s) is more useful, and that takes copying and pasting.

              If you would like to practice a bit more, use the Test forum.

            • #701050

              OK. With IPB software, you can edit the quote and delete stuff you don’t want at the same time as you are writing your new post. Selective quoting is expected of all good net citizens…

            • #701004

              It sounds like it MAY be a bug in Outlook. shrug This kind of rule is more likely to be a server-side rule, rather than a client-side rule, and maybe Outlook can’t always understand that you can quite validly run the rule.

            • #700916

              I didn’t realize I could need permission to delete an e-mail message. laugh

              Is this mail coming through Exchange Server?

            • #700983

              Nope. No Exchange involved here. Straight OL 2002. I’ve gotten this message 3 times in the last 2 days. Unsure what triggers it, why it happens, what it means or why the rule gets turned off when it happens. Typical MS….

    • #709079

      Apparently, you can now use (limited) VBA in Outlook. So might be able to do IF-Then-Else logic. But Outlook doesn’t support the full object model, so there are lots of gotchas.

      How to Create a Custom Rule Using Visual Basic for Applications
      http://support.microsoft.com/default.aspx?…kb;en-us;235852

    • #709080

      Apparently, you can now use (limited) VBA in Outlook. So might be able to do IF-Then-Else logic. But Outlook doesn’t support the full object model, so there are lots of gotchas.

      How to Create a Custom Rule Using Visual Basic for Applications
      http://support.microsoft.com/default.aspx?…kb;en-us;235852

    Viewing 2 reply threads
    Reply To: Rules logic (OL2002 SP2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: