【问题标题】:Outlook 2007: Create a message rule that detects autoforwarded messages and handles themOutlook 2007:创建检测自动转发邮件并处理它们的邮件规则
【发布时间】:2013-01-27 12:27:10
【问题描述】:

我正在寻找一种与创建自动转发规则相反的方法 电子邮件。我想创建一个对收到的自动转发电子邮件起作用的规则, 但不是由同一个人手动转发或回复的任何内容。

例如Jim 将所有主题带有“blah”的电子邮件转发给我,我想 将这些自动转发移动到我的“Jim 的自动转发”文件夹,但如果他 手动向我转发一条消息,上面写着“blah”,但他添加了自己的 cmets, 我希望它留在我的收件箱中。

Outlook 似乎知道它是自动转发的,因为它显示 因此,当您查看电子邮件时。就在“发件人”部分的上方,但 就在功能区下方,它说的是:

"This message was AutoForwarded."

但是我没有找到任何选项来创建过滤这些的规则。

【问题讨论】:

    标签: email outlook rules forward


    【解决方案1】:

    我们的交换服务器(可能是 Outlook?)在自动转发时添加以下标头:

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

    (通过打开电子邮件并查看“属性”消息以查看标题即可看到)这些似乎是 Outlook 用来检测邮件是否为自动转发(或至少一致)的内容

    并且 Outlook/Exchange 2013 具有过滤选项“在邮件标题中包含指定的单词”

    我使用了类似于以下内容的规则,成功地将仅从“Jim”自动转发的“blah”主题消息移动到特定文件夹:

    Apply this rule after the message arrives
    from 'jim@example.com'
     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
    

    这似乎可以防止他手动转发的任何内容被相同的规则处理。

    【讨论】:

    • 我发现这个在我们的交换服务器上运行可靠。
    【解决方案2】:

    我们的 Exchange Server 为自动转发和自动回复添加了以下标头

    X-MS-Exchange-Inbox-Rules-Loop: abc@company.com
    

    其中 abc@company.com 是自动转发电子邮件的人的电子邮件。

    我使用已设置规则的 MS Outlook 2010 ->

    From: abc@company.com and with 'X-MS-Exchange-Inbox-Rules-Loop: abc.xyz@company.com' or 'X-MS-Exchange-Inbox-Rules-Loop: abc.XYZ@company.com' in the message header move it to the 'xyz' folder

    我已经检查了邮件标题中的 abc.xyz@company.comabc.XYZ@company.com,就像在某些自动转发/重新电子邮件标题中一样发件人的姓氏是大写的。

    注意:如前所述,此规则适用于该人的所有自动转发和自动回复(例如外出/休假自动回复)。手动转发/RE 电子邮件不会被过滤

    【讨论】:

    • 在 Outlook 2016 中为我工作
    【解决方案3】:

    我不认为规则可以做到这一点。

    尝试一些 VBA。 未经测试

    编辑 2013 02 26

    将代码放入ThisOutlookSession http://www.slipstick.com/outlook-developer/how-to-use-outlooks-vba-editor/

    这里有一些参考,如有必要,您可以进行调试。

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

    自动转发属性: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
    

    【讨论】:

    • 如何将其添加到我的 Outlook 中,以便在我收到电子邮件时自动运行?
    • @dstronczak 我添加了一个链接来描述代码的去向。
    • 这一行出现了某种错误:If objItem.SenderName = "MyCollegueName" Then
    • @dstronczak 从 Jim 中选择一个项目。在即时窗格中输入 ?ActiveExplorer.Selection.Item(1).SenderName。
    猜你喜欢
    • 2011-01-19
    • 1970-01-01
    • 2011-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-15
    • 1970-01-01
    • 2022-08-04
    相关资源
    最近更新 更多