Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine original vs. reply emails with mail flow rules?

Using Exchange via Office365. My organization would like to write mail flow rules on the condition that the email is or is not a reply. All original//initiating emails would get one rule, all replies//responses get another. There doesn't seem to be a way to do this natively (at least I can't find it) -- but did someone find a workaround that has the same effect?

like image 463
rgmatthes Avatar asked Sep 03 '25 07:09

rgmatthes


1 Answers

Only got voted down here, which is disappointing. I looked all over the bloody internet and found no good answers to this question. Many folks said this could not be done without a third-party tool. But I did come up with something to suit my needs, so I'm posting it here so it's Google-able for the next lost soul:

In order to group email conversations into chains, Exchange injects a bit of metadata into email message headers. The following instructions will create a mail flow rule to check for a value matching a regex expression in that metadata. If Exchange can't find anything, the rule will kick off as normal, but if it does find a value, the email must be a reply and therefore the mail flow rule will not fire.

For a mail flow rule that only should run on an initial email, not a reply:

  1. From Admin -> Exchange -> Mail Flow -> Your Rule, provide a name, conditions, and actions as normal.
  2. Click "More options..." near the bottom if this has not already been selected.
  3. Click "Add Exception."
  4. Under "Except if...", select "A message header matches these text patterns."
  5. Click "Enter text..." and enter a header name of "In-Reply-To" (no quotes).
  6. Click "Enter text patterns..." and enter this expression: "<.@.>" (no quotes).
  7. Save your rule as normal.

Hope this helps someone.

like image 103
rgmatthes Avatar answered Sep 04 '25 23:09

rgmatthes