dstronczak
dstronczak

Reputation: 2464

Outlook 2007: Create a message rule that detects autoforwarded messages and handles them

I'm looking for kind of the opposite of creating a rule to auto-forward emails. I want to create a rule that acts on RECEIVED auto-forwarded emails, but not any that were manually forwarded or replied to by the same person.

E.g. Jim forwards me all emails with "blah" in the subject, and I want to move those auto forwards to my "Jim's auto-forwards" folder, but if he forwards me a message manually that says "blah" but he adds his own comments, I want it to stay in my inbox.

Outlook seems to know that it is auto forwarded, as it shows up as such when you view the email. Just above the "From" section but just below the ribbon, it says something like:

"This message was AutoForwarded."

However I haven't found any option to create a rule filtering these.

Upvotes: 5

Views: 5786

Answers (3)

Rohan K
Rohan K

Reputation: 21

Our Exchange Server adds the following header for Auto Forwarded and Auto Replies

X-MS-Exchange-Inbox-Rules-Loop: [email protected]

where [email protected] is the email of the person auto forwarding the email.

I use MS Outlook 2010 in which i have setup a rule ->

From: [email protected] and with 'X-MS-Exchange-Inbox-Rules-Loop: [email protected]' or 'X-MS-Exchange-Inbox-Rules-Loop: [email protected]' in the message header move it to the 'xyz' folder

i have checked [email protected] as well as [email protected] in message header as in some auto Fwd/Re email header the Lastname of the sender was uppercase.

Note: as mentioned before this rule applies to all Auto Forwarded and Auto Replies (e.g Out of office/ vacation auto replies) from that person. Manual Fwd/RE emails are not filtered

Upvotes: 2

Arkaine55
Arkaine55

Reputation: 548

Our exchange server (Outlook maybe?) adds the following headers when auto-forwarding:

Auto-Submitted: auto-generated
X-MS-Exchange-Generated-Message-Source: Mailbox Rules Agent

(Visible by opening an email and viewing the message "Properties" to see the headers) These appear to be what Outlook is using to detect that a message was AutoForwarded (or at least coincide)

And Outlook/Exchange 2013 has the filter option "with specified words in the message header"

I have used a rule that looks similar to the following to successfully move only "blah" subject messages autoforwarded from "Jim" to a specific folder:

Apply this rule after the message arrives
from '[email protected]'
 and with 'blah' or 'blurg' in the subject
 and with 'auto-generated' or 'Auto-Submitted' in the message heade
move it to the 'Jims auto-forwards' folder

And this has appeared to prevent any that he's manually forwarded from being processed by the same rule.

Upvotes: 2

niton
niton

Reputation: 9199

I do not think rules can do this.

Try some VBA. untested

Edit 2013 02 26

Put the code in ThisOutlookSession http://www.slipstick.com/outlook-developer/how-to-use-outlooks-vba-editor/

Here are some references so you can debug if necessary.

NewMailEx: http://msdn.microsoft.com/en-us/library/office/bb147646(v=office.12).aspx

AutoForwarded Property: http://msdn.microsoft.com/en-us/library/office/ff867162.aspx

    Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
    Dim varEntryIDs
    Dim objItem
    Dim i As Integer

    Dim myOlApp As Outlook.Application
    Dim myNameSpace As Outlook.NameSpace
    Dim myInbox As Outlook.MAPIFolder
    Dim myDestFolder As Outlook.MAPIFolder

    varEntryIDs = Split(EntryIDCollection, ",")
    For i = 0 To UBound(varEntryIDs)
        Set objItem = Application.Session.GetItemFromID(varEntryIDs(i))

        'Debug.Print "NewMailEx " & objItem.Subject

        If objItem.SenderName = "Jim Smith" Then

            If objItem.AutoForwarded then

              Set myNameSpace = myOlApp.GetNamespace("MAPI")
              Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)

              ' Assumes destination folder is directly under the Inbox
              Set myDestFolder = myInbox.Folders("Jim AutoForwarded")
              objItem.Move myDestFolder

            End If
        End If

   Next
   Set objItem = Nothing
   Set myDestFolder = Nothing
   Set myInbox = Nothing
   Set myNameSpace = Nothing
   End Sub

Upvotes: 1

Related Questions