How do I set up a rule to delete incoming Out of Office replies only from external email addresses?

BloodCenter used Ask the Experts™
In Outlook 2003, how do I configure a rule so that I don't get spammed with a bunch of Out of Office replies from people outside my Microsoft Exchange Server?  Thanks!
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Alan HardistyCo-Owner
Top Expert 2011

I am not aware of a way to do this - you can't set an 'excluding internal people' you can only set a rule from certain people, but that would be a long list!
Chris BottomleySoftware Quality Lead Engineer
Top Expert 2011

Hello BloodCenter,

OUt of office replies outside of exchange, identifying personnel outside of the server is easy enough but i'm not sure out of office messages are that easy to single out or are you happy to 'drop' all messages from outside the server with for exampel out of office in the subject or body?



Anything not with our domain name or not within our server could be dropped.
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Expert of the Quarter 2009
Expert of the Year 2009
Configuring a rule for Out of Office is quite easy - filter on the subject. You will need to have a number of variations though, because different versions of Outlook and Exchange show the subject line in slightly different ways.

However I think that would apply to all out of office messages, both internal and external. I don't think the rules engine is intelligent enough to work it out.
Of course you could use the rule "where x appears in the headers" (I can't remember the exact text as I have Outlook 2010 in front of me at the moment) and then enter the OOTO text. An internal message wouldn't have headers so wouldn't get filtered. (That is a theory, so test it).

Chris BottomleySoftware Quality Lead Engineer
Top Expert 2011
In VBA you need to add a routine as in the snippet:

Alt + F11 to open the macro editor
     In the project tree select as appropriate:
      OUTLOOK      : thisOutlookSession
     In the workpane select as appropriate:
      OUTLOOK      : Application
     In the workpane select the required 'event', (i.e. newmailex).
     Insert the required code into the selected subroutine.
Close the Visual Basic Editor.

Check Security as appropriate:

In the application select Tools | Macro | Security
Select Medium
Select OK

As it stands if the senders address has a "@" in it the subject will be modified ... hopefully, if that works ok it can then be easily modified to delete them but for now just in case!  I'm not sure if the save is required but i'm not on domain at the moment so trying to recall from memory.

Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim strEntryID() As String
Dim testObj As Object
Dim intFinal As Integer
    strEntryID = Split(EntryIDCollection & ",", ",")
    For intFinal = 0 To UBound(strEntryID) - 1
        Set testObj = Application.Session.GetItemFromID(strEntryID(intFinal))
        If testObj.Class = olMail Then
            Set mai = testObj
            Debug.Print mai.SenderEmailAddress
            If InStr(mai.SenderEmailAddress, "@") > 0 Then
                 mai.subject = "DeleteMe? ... " & mai.subject
            End If
        End If
End Sub

Open in new window

Alan HardistyCo-Owner
Top Expert 2011

That's cheating ;-)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial