We also have this problem with SMTP.

The "hack" worked OK for the accounts we use to only receive email, but the account we use to send cannot authenticate:

This is not a new account, used to work fine up until yesterday.

    KevinTheJedi

    Thanks for confirming. I have disabled and enabled Authenticated SMTP for these accounts and will be testing in a few hours.

    KevinTheJedi

    I created a ticket with Office 365 support and they recommended a test via powershell:

      Let's first turn off MFA, Conditional Access Policies, Security Default.
     
      Then you could run PowerShell commands below to narrow down done if the issue occurs within our side. If the PowerShell command can send successfully, then the issue occurs within just the app scope but not from our side.
     
      $cred = get-credential
      Send-MailMessage -To "user@domain.com" -from "user@domain.com" -Subject 'Test message' -smtpserver smtp.office365.com -usessl -Credential $cred -Port 587

    The results of that test email were successful and I received it from one of the accounts that is used by OSTicket.

      mrudella

      Then I am unsure. It’s working for everyone else so it’s a config issue somewhere in your end.

      Cheers.

        KevinTheJedi As I said it's not working for us either, so it's definitely not working for "everyone else". Has anyone else confirmed specifically that SMTP works for them?

          symoss mrudella

          The only thing I can recommend at this point is to maybe create a brand new App Registration in Entra and following the osTicket OAuth2 documentation exactly as it states. Also, you should now be using the Scopes of offline_access https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/POP.AccessAsUser.All https://outlook.office.com/SMTP.Send.

          As long as you modify the plugin as stated above, use the correct Scopes, and authenticate as the correct user you should have no issues. I just retested with my O365 personal email and it's working as intended for both IMAP and SMTP using these instructions.

          Cheers.

          @symoss how long do you use this account?
          Maybe your certificate is outdated. You can check your client secret. It will expire all two years.

            KevinTheJedi
            i got the plugin edited, i cant seem to figure out how to manipulate our database. i was able to login to mariadb, i got to the database, and tablet contents, but im strugging to put together the right update command to change the install path and the 1 to 0. can you provide any help on this? also, im using Government 365 if that matters.

              bbertling

              Ahhh then you have completely different endpoints and everything. All endpoints for O365 government end in .us instead of .com. Furthermore SMTP is typically disabled for Government tenants and you typically use a relay for that.

              As for the SQL, you should use a GUI tool instead if you don’t know how to run/write SQL statements as you can mess up quite a bit. I would recommend HeidiSQL for windows and Sequel Ace for Mac.

              If you require a manual query you would just simply run:

              UPDATE %TABLE_PREFIX%plugin SET `install_path` = 'plugins/auth-oauth2', `isphar` = 0 WHERE `id` = %PLUGIN_ID%;

              Replace %TABLE_PREFIX% and %PLUGIN_ID% with their respective values.

              Cheers.

                KevinTheJedi
                ok, so do i stop what im doing and make a relay connection? or can i continue to follow your instructions with HeidiSQL to get a solution? or am i the Guinea Pig to see if it works on the gov side?

                  bbertling

                  You can continue I’m just relaying my experience with these tenants. The relay should already be there however if not you can enable and use SMTP. It’s up to you.

                  Cheers.

                  @mrudella if your SMTP Authentication don't work with oAuth2, you can use basic authentification for it.
                  As far as I know, oAuth2 is only required for email fetching...

                  Thanks, that's exactly what I ended up doing. I was unable to resolve the issue any other way.

                  its working. confirmed the changes and authentication is working well.

                  @KevinTheJedi can confirm the modified plugin callback function got things running again for us