https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38338 --- Comment #42 from David Cook <dcook@prosentient.com.au> --- (In reply to Olivier Hubert from comment #41)
(In reply to David Cook from comment #37)
Jumping back to Perl... it looks like Email::Sender::Transport::SMTP and Email::Sender::Transport::SMTP::Persistent connect to the SMTP server only at the time they're sending the email... so you can't test the authentication until sending time...
If there is an auth error, we'd have to create a new transport and re-try with the new transport...
I'm not sure what you mean by having to recreate the transport, but I'm not the most familiar with the way Koha sends email.
I thought that having the token created (and refreshed) separately would ensure that the token we have is always valid. Given that we should be reasonably sure that the token is good, why would a transport error necessitate the creation of a new transport?
Sorry for the confusion. Originally, I wasn't sure that we'd have a mechanism for tracking token expiry, so I was thinking the only way to know would be at error time, but yeah nah if the check is done before creating the transport object which should handle the SMTP connection, it should be all good. No worries!
By the way, I was able to get a working version of a test script sending, but as mentioned on Mattermost, the configuration of the instance required that we use the URL https://login.microsoftonline.com/[TENANT_ID]/oauth2/v2.0/token along with the "https://outlook.office365.com/.default" scope (instead of something like "https://outlook.office365.com/SMTP.Send"). I think the different configuration in Azure instances will increase the variability of scenarios. Certainly compared to using Gmail anyway.
Yeah I think you're right. It looks like different Microsoft accounts have different endpoints. So long as the endpoint is configurable, I don't think there should be any dramas though. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.