IMAP, SMTP scopes are targeted for Exchange resource and not Graph. Whereas User.Read, Mail.ReadWrite are meant for Graph resource.
We do not support generation of tokens that are meant for two resources. Hence the error "Provided value for the input parameter scope is not valid because it contains more than one resource."
You should generate two tokens separately by two calls to /token.
- One with the IMAP, SMTP scopes generated for the Exchange resource.
- The other with Graph scopes (User.Read, Mail.ReadWrite) meant for Graph resource.