Hi,
We have use cases where form process emails must come from specific departments when advising the user of process details (ex. emails from HR or Finance). Each of these departments have their own emails.
When I try to configure Forms with the new-ish Microsoft 365 OAuth 2.0 configuration available in the Forms Config, when I configure the sender's email account, the emails go through no problem through that user. However, if on a Forms process, I specify a different user in the From field of the email who's not the sender's email account in Forms Config, I get an authentication error.
How do I go about allowing this scenario? I know we need to match on the UPN of the user accounts for authentication, but it seems like sending an email through a different sender account is not a thing?
In O365, I have these API permissions:
The error I receive from Forms (12.0.2509.20409):
Stack Trace:
Caught exception: Laserfiche.Forms.CommonUtils.Exceptions.LFFormsException
Message: Failed to connect to the email server smtp.office365.com:587. [LFF2013-SMTPServerConnection]
at Laserfiche.Forms.CommonUtils.EmailDeliverFactory.DeliverEmailSync(IEntityContext context, EmailMessage em)
at FormsModel.DomainServices.EmailSendService.SendEmailForEmailServiceRuntime(EmailService emailService, cf_bp_worker_instances wi, IRoutingContext routingContext, RoutingInstanceStatus originalStatus)
at Laserfiche.Forms.Routing.RuntimeEmailService.Execute(Int32 instanceId, IRoutingContext routingContext, RoutingInstanceStatus OriginalStatus, FormsHistoryContext& historyContext)
at Laserfiche.Forms.Routing.RuntimeServiceTask.Execute(Int32 instanceId, IRoutingContext routingContext)
Inner exception: Limilabs.Client.SMTP.SmtpResponseException
Message: Authentication unsuccessful [XXX.XXX.PROD.OUTLOOK.COM 2025-11-10T03:17:10.047Z 08D1234]
at Limilabs.Client.SMTP.Smtp.LoginOAUTH2(String user, String accessToken)
at Laserfiche.Forms.CommonUtils.EmailDeliver.InitializeAuth2EmailSending(IEntityContext context, EmailMessage em)