Mark email messages received with delay

0

For many reasons an email message can be hold up in mailservers for several hours or even days.

I wanted to create a rule that assigns a given category to messages received with a delay greater than x minutes, but that's not doable with outlook rules.
I'm guessing that something in the line of that can be achieved with a VBA macro or a Powershell script, maybe comparing the message headers date with the inbox date.

I'm struggling to find a solution and I'm not a programming expert, so any help will be highly appreciated.

I'm using Outlook 2016 with an office365 account on Windows10.

João Fonseca

Posted 2019-05-20T10:11:45.747

Reputation: 1

Not sure this is even possible. Can you at least see in the headers vs current time that there is a delay? – LPChip – 2019-05-20T10:17:52.140

@LPChip The headers have several Received: lines with info about each server the message went trough. I can see the delay there (see this article https://mail.aegee.org/delays/headers.html ). It should be possible to compare date and time on the first record with the date and time of the last record.

– João Fonseca – 2019-05-20T10:38:17.173

that's going to make things hard because some mails only have one received header, where others may have multiple, and then the delay can vary too. Technically it is possible, but I don't know how. – LPChip – 2019-05-20T10:53:04.217

2But it might be helpful if you explain why you want to do this. There may be a more straightforward answer here that is easy to implement. – LPChip – 2019-05-20T10:53:43.013

Well, I want to do this because the mailserver of my client is very unstable, but is the only way I have to receive alarms about his system (wich I'm monitoring). I want to discard alarms I'm receiving now, but were triggered 2-3 days ago. Regarding the Received header, I guess if you compare the first record with the current time will do. – João Fonseca – 2019-05-21T15:14:59.243

Answers

0

Actually, this is doable with Outlook rule and run a script action (you may need to use the EnableUnsafeClientMailRules registry value to unlock it).

In a VBA script that created Outlook rule will fire, use MailItem's SentOn and ReceivedTime properties to calculate a delay. After that use the Categories property to assign a required category.

thims

Posted 2019-05-20T10:11:45.747

Reputation: 8 081