I’m running Nextcloud on Ubuntu 22.04.2 LTS. I’ve been unsuccessful with getting Nextcloud to send mail via smtp.office365.com and getting this error
A problem occurred while sending the email. Please revise your settings. (Error: Failed to authenticate on SMTP server with username “username@hostname” using 1 possible authenticators. Authenticator LOGIN returned Expected response code 250 but got code “535”, with message "535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [CH0PR03CA0085.namprd03.prod.outlook.com 2023-04-06T15:42:51.009Z 08DB368285175829]
".)
The account that’s being used in valid because we have other clients which are able to use it.
No, each box has its own independent shared mailbox in Office365 which in turn has the send as permissions to allow a delegate to send email from their mailbox. So nextcloud@whatever, wordpress@whatever and so on.
Try using a known working sending address just to rule out anything having to do with that.
This is an older post but someone posted you can’t send with SMTP from a shared mailbox with send-as permission. Don’t know if that’s still the case or not.
I would consider using a relay connector instead. It’s a little more work on the front end, but then you don’t run into auth issues.