Hi Community,
there are already a few threads about this topic but none of them really meets what I wanted to discuss with you as the possible solution for the full fledged use of Shared Mailboxes. We already can use Shared Mailboxes from M365 as INBOXES without any problems, so first of all thanks for an excellent extension.
When it comes to SENDING mails using a shared mailbox we run into severe limitations with the known workaround of sending with the personal mail or temporarily licencing the shared mailbox as a user. I investigated escpecially into the latter and it pointed me to the right direction as I think. Here is what I found when using Graph API for sending mails, SMTP is restricted too narrow here for me:
The Microsoft GRAPH API has TWO endpoints for sending mail with fully different behaviour. The URI
is strictly limited to the use for personal (and thus LICENCED !!!) mailboxes. This was the hint that I was missing. The second URI
is for use with shared mailboxes where the placeholder ist then replaced with the mailadress of the Shared Mailbox, e.g. /users/forum@espocrm.com/sendMail.
Unfortunately in one of the base configuration / properties file of the extension - do not remember exactly which one and cannot check while writing this ... - there is the FIRST Url hard coded as the base URL for the complete extension.
I did not dive too deep into the code of the module but is there any way of "easily" implementing this logic:
What do you think, Yuri?
Regards
Michael
there are already a few threads about this topic but none of them really meets what I wanted to discuss with you as the possible solution for the full fledged use of Shared Mailboxes. We already can use Shared Mailboxes from M365 as INBOXES without any problems, so first of all thanks for an excellent extension.
When it comes to SENDING mails using a shared mailbox we run into severe limitations with the known workaround of sending with the personal mail or temporarily licencing the shared mailbox as a user. I investigated escpecially into the latter and it pointed me to the right direction as I think. Here is what I found when using Graph API for sending mails, SMTP is restricted too narrow here for me:
The Microsoft GRAPH API has TWO endpoints for sending mail with fully different behaviour. The URI
Code:
POST /me/sendMail
Code:
POST /users/{id | userPrincipalName}/sendMail
Unfortunately in one of the base configuration / properties file of the extension - do not remember exactly which one and cannot check while writing this ... - there is the FIRST Url hard coded as the base URL for the complete extension.
I did not dive too deep into the code of the module but is there any way of "easily" implementing this logic:
- if mail account is "Personal Mail Account" then use /me/SendMail as the baseURL
- if mail account is "Group Mail Account" then use /users/{id | userPrincipalName}/sendMail as baseURL
What do you think, Yuri?
Regards
Michael
