What's an efficient way to get NDR per-recipient information (such as PR_NDR_DIAG_CODE) via EWS?

I need to get the per-recipient information for NDRs via EWS. The following properties were fairly easily accessible with MAPI:

PR_NDR_DIAG_CODE, PR_NDR_REASON_CODE, PR_REPORT_TEXT, PR_REPORT_TIME, PR_SUPPLEMENTARY_INFO

but appear to be inaccessible with EWS.

I've seen older posts that say the only way to get them is to get the MIME (and presumably parse it yourself - more potentially error prone code we have to write), however, elsewhere I read that "we do not recommend that you use MIME. Exchange doesn't store MIME content and MIME content conversion is expensive"

So, is there any alternative to obtaining this information that I've not discovered using EWS with Exchange 2013 (or later)?

April 22nd, 2015 6:13am

The properties your talking about are part of the recipients collection and aren't returned via EWS and you can't specify to return extended properties on recipient or attachment collection with EWS (this has been the same since 2007).

MIME while it does come up at a performance cost is a standard so you should be able to build a reasonably reliable parser for it. (The performance cost isn't that bad eg if you have POP or IMAP users that's what they use)

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
April 23rd, 2015 2:37am

Cheers Glen.

I was hoping that MS may have realised that this was notably missing from EWS and have provided some neat way of getting it by now. I guess my hope was misplaced.

The problem with everyone who needs this having to write it themselves is that it's inevitably error prone. The more code we have to write, the more chance there's a bug lurking. This is always the case with text parsing no matter how "machine parsable" the standard says it's supposed to be; there's always some edge case or rogue implementation that throws a spanner in the works.

FWIW, if anyone thinks this data ought to be more accessible via EWS, I've created a uservoice request - please add your vote to that.

Ideally, I'd have expected that there would have been derived types for NDRs and RN's etc. that would have provided a neat way of getting their specific information.

April 23rd, 2015 5:33am

The properties your talking about are part of the recipients collection and aren't returned via EWS and you can't specify to return extended properties on recipient or attachment collection with EWS (this has been the same since 2007).

MIME while it does come up at a performance cost is a standard so you should be able to build a reasonably reliable parser for it. (The performance cost isn't that bad eg if you have POP or IMAP users that's what they use)

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
April 23rd, 2015 6:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics