Forum Discussion
Rejecting message based on email header ( in Office365 )
Hello Ramu Denduluri,
Where does the header get added in? Is this being done by a third party system or server before it is reaching O365, or is this being done by the client of the users.
My first though was if this is being done somewhere for the users, it may be the case that the header value is not there when it is being processed through the edge/gates for your users.
I have had success searching for "x" headers, which I know are added in, so I would be a bit surprised if it was missing it.
Would you be able to post atleast the part of the header the action section is included in for our curiosity sack.
Also it sounds like you have done some good due diligence, this might be one of the cases where you ultimately have to open up a premier case with Microsoft, as there is only so much we here on the forums can do without access to the actual servers. Most of our talk and suggestions are going to be speculative/based on our own experiences. Atleast to me in this case you seem to be pretty thorough in what you have done and tested, I am not sure how much we can find out without getting our hands dirty so to say.
Adam
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.
- Rishank GangulyOct 26, 2018Brass Contributor
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
- Andy DavidOct 26, 2018MVP
If you telnet on port 25 to a mail server of your choice and manually send a test message with that header, does it show up?
- Ramu DenduluriOct 26, 2018Copper Contributor
Hi Andy,
I tested sending email to a different smtp server using javamail client with header set and the header shows up on the other side. The same email client I used for testing with Exchange online just to be consistent but no avail.
Thanks
- Andy DavidOct 26, 2018MVP
Did you test with telnet on port 25 sending to Office 365? Remove the client from the equation just to see.