rule to identity incoming messages from non-exchange email address
-
Monday, April 16, 2012 2:59 PM
I'm a developer, and because of my group associations, I receive literally hundreds of email a day every time some service performs or fails to perform some function. These email accounts (webservice1@myemployer.com) are not exchange accounts. If i right click on the address and select properties I get the non-exchange properties image below.
I simply want to be able to create a rule that will identity these mass emails and put them into their own folder.
- It can not be done by the "distribution list" as someone can send an email to the "AppDev" group which I need to respond to.
- It can be done by looking for the specific from address, but that is time consuming and repetitive and "ugly"
- It can not be done by message or subject text as the outlook filters are not that intelligent and I can't possibly know every new alert message that will be created
If I could check if the from address is an exchange account as opposed to pop3/image, that would do it. Obviously Outlook is able to differentiate these "types" of accounts as selecting properties from the context menu give you two different types of dialog boxes.
***********************
How do I set up a filter that will let me filter messages from non-exchange accounts.
non-exchange properties
exchange properties
Thank Kevin
All Replies
-
Monday, April 16, 2012 3:07 PM
Look at the SenderEmailType property - it will be SMTP as opposed to EX.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.3 is now available!
-
Monday, April 16, 2012 3:21 PM
Dmitry,
My first stupid question of the day... where can I use that in a rule?
I pasted SenderEmailType into the selected properties "define more criteria" field and it balked "The Field you specified cannot be found".
Thank Kevin
-
Monday, April 16, 2012 6:22 PM
That property is available in the Outlook Object Modle, and you can access it in a script.
For a rule, have you tried "specific words in the sender's address"?
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.3 is now available!
- Marked As Answer by kevcoder Monday, April 16, 2012 8:37 PM
- Edited by Dmitry Streblechenko _MVP_MVP Tuesday, April 17, 2012 9:41 PM
-
Tuesday, April 17, 2012 8:14 PM
In case anyone is interested. This works
Public WithEvents myOlItems As Outlook.Items Public Sub Initialize_handler() Set myOlItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items End Sub Private Sub myOlItems_ItemAdd(ByVal Item As Object) Dim myOlMItem As Outlook.MailItem Dim myRecipient As Outlook.Recipient Dim myInbox As Outlook.Folder Dim myNameSpace As Outlook.NameSpace Dim myDestFolder As Outlook.Folder Set myNameSpace = Application.GetNamespace("MAPI") Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox) Set myDestFolder = myInbox.Folders("DevSupport") Dim recipientTrigger As String recipientTrigger = "devsupport" Set myOlMItem = Item With myOlMItem 'is this coming from a non-exchange address: a programatically generated message If .SenderEmailType <> "EX" Then 'is this message sent to a group address For Each myRecipient In myOlMItem.Recipients If LCase(myRecipient.Name) = recipientTrigger Then 'move the message to the AppDev folder for later ignoring .Move myDestFolder End If Next 'MsgBox "incoming smtp mail with subj = " & .Subject End If End With End Sub
Thank Kevin
-
Thursday, April 19, 2012 3:51 PM
Dimitry,
The code I wrote works when it runs and that seems to only be when I open the project and hit F5 to run it.
I digitally self signed it. How do I get this to run every time outlook runs?
Thank Kevin
-
Thursday, April 19, 2012 4:49 PM
You can use Application.MAPILogonComplete event to run your code as soon as Outlook starts up and logs to a MAPI profile.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.3 is now available!

