cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching Mail from an O365 mailbox with SAP PI

epempe
Discoverer
0 Kudos

Hi all,

I am currently facing the problem of fetching mail from an O365 mailbox with the SAP PI SP20 to forward them to our internal backend SAP System.

My first idea was to use the mail adapter (mail sender), as it supports OAuth. My first hurdle, however, is communication into the cloud, as we only communicate on the Internet via our proxy, PI will not be placed in the DMZ or communicate anyway directly to the internet. I'm missing the proxy setting in the mail adapter and we also discussed whether the IMAP protocol could even be routed via our proxy.

The second idea is to use Microsoft's Mail API. But here I get stuck on the OAuth login, because the OAuth Flow we can use in SAP REST Sender (polling) is e.g. Client Credentials Grant. But O365 says: "OAuth access to IMAP, POP, SMTP AUTH protocols via OAuth2 client credentials grant flow is not suppo..."

On the other side O365 is using the "Authorization Code Grant", but this one is not supported by SAP. SAP says: "Please, note that other grant flows such as Authorization Code Grant and Implicit Grant, require end...

Currently I don't find a flow wich is accepted from both sides. Does any one have an idea to connect with REST Sender (polling) or Mail Sender Adapter to O365 to fetch mails with SAP PI? With CPI I find a nice blog, but we need the solution for PI.

During our search and as time went on, we came across Microsoft is working on a solution to add the Client Credential OAuth flow with its Microsoft feature id 70577 in December 2021.

I don't find in the Road Map Explorer a hint for the implementation of "Authorization Code Grant". Is SAP also taking a step forward and expanding the OAuth flows?

Thank you for your support and sharing your ideas.

BR Erik

Accepted Solutions (0)

Answers (1)

Answers (1)

sbuttler77
Active Participant
0 Kudos

hi Erik,

did you ever manage to make this work? We were user/pass authentication to poll emails off

of Exchange but I'm being told this is no longer an option and I have been given Graph API

credentials. I would have hoped for SAP provide some instructions in form of an OSS note

but there's nothing in OSS.

Thanks,

Sven