Forum Discussion
Rejecting message based on email header ( in Office365 )
Hi Adam,
Header is being added by smtp client (Header name is Custom-Header in this particular case and value is block, I have adjusted my rule to reflect the correct header name).
Below is snippet from smtp client logs:
--------------
Message-ID: <425255836.1.1540471453322.Mail.user@host>
Subject: This is test subject
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Custom-Action: block
This is test email body.
.
250 2.0.0 OK <425255836.1.1540471453322.Mail.someuser@somehost> [Hostname=MWHPR14MB1135.namprd14.prod.outlook.com]
--------------
When the recipient receives email (which it should not if rejection rule works correctly) I can see mail headers in outlook File > Info > Properties, Internet headers, I do not see my custom header. Exchange seems to be stripping / rewriting headers. But is it stripping the header before running through transport rules, I have no way of knowing.
Btw- I can confirm that I have seen the same rule hitting atleast once (couple of days ago) but it stopped working the next day (I don't remember making any config changes in between). After it stopped working, no matter what I do , rule would not match . I have removed all transport rules, connectors etc and just kept this single rule to make sure there are no conflicts.
Thanks for your help, I would like know what is the best place to post this question ?
Regards.
Hi Ramu,
This will not work, as you are trying to block an email using a Custom header which is generated by a Java Email Application. Custom Headers does not fall under predefined rules in Transport for Office 365 as far as I know. You can reach support, however, i know their answer. These things does not fall under Office 365 scope.
Thanks,
Rishank Ganguly
- Ramu DenduluriOct 27, 2018Copper Contributor
Hi Rishank,
I have already reached out to support. They said they will look into the issue.
Any idea if it would work for headers such as Message-Id or Content-Type . These are typical headers that every message includes. I have verified it work for From and To headers, but there are specific rules for such fields (from/to/cc/bcc/subject). You can guess that Exchange treat these as fields, not headers. Then why provide rules which talk about mail headers, just wondering.
Thanks for your help.
- Rishank GangulyOct 28, 2018Brass Contributor
Hi Ramu,
You are right, Exchange treats all these as typical headers, and they accept values from any email systems. So these can be treated as Fields. Now, there are some X-MS headers which accepts certain values. Check this article if it helps:
https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-provision-x-headers-by-using-ews-in-exchange