Trying to achieve: email notification configurations under General settings using Microsoft Outlook 365 account from my organization.
I’m using an Office 365 account to set up email notifications for our sonarqube installation. Just about every configuration I’ve tried resulted in the “test email” response from sonarqube saying “Configuration invalid: please double check SMTP host, port, login and password.”. The error message never changed throughout all my troubleshooting steps.
Here is what I have tried to so far:
Configured Microsoft email using settings found here, along with my email = sonar.user@myorg.com, password=mypassword. When that didn’t work, I set up 2FA so that I could use a Microsoft “app password” (basically an api key like setup that doesn’t require 2FA). Lastly I tried my personal microsoft live account to see if the lesser security restrictions from not being a part of my company organization would get this to work, it did not.
Google email account. I found Google’s SMTP configuration and tried with those settings. When I saw that Google no longer allows “Less secure apps access” as someone mentioned in a Youtube Video, I figured that was no longer an option as well.
Last troubleshooting step that leads me to believe that email security is thwarting success, was find an insecure email sever and provide it’s smtp server and mock email for testing. Using this online and insecure SMTP server, I put in dummy credentials and SMPT port 25… Email sent successfully. The email server lets you see emails sent to the inbox, which verified that sonarqube was sending emails with dummy credentials and this email server.
Are these confirmed settings for sending mail through an Office365 email address? I’ve seen two other smtp server names in other places, which is why I’m asking.
Second, have other users successfully used email notifications with Microsoft email address?
I can successfully send the email through SonarQube using the SMTP settings you provided.
Make sure you are using the same email address in the “SMTP username” and “From address” fields. It seems to be mandatory for Outlook.
I put the same email address in “SMTP username” and “From address”, unfortunately i’m still receiving “configuration invalid: please double check SMTP host, port, login, and password”.
Are you using a Microsoft Live email or an Office365? I am using an Office365 email at our company’s domain. ie security@mycompany.com
You are right I used a Microsoft Live email. Unfortunately, I don’t have access to an Office365 account to test this. Did you activate SMTP auth for the account as described on this page?
In your first post you said that it didn’t work either with your live account, maybe the SMTP username and “From address” were not matching?
The error message you are receiving is generic and the error returned when trying to send the email is not logged. This is not great, I will open a ticket to at least log the issue and maybe add more details in the message returned to the user in the UI.
It is possible to see the error message in the server logs when triggering an event that should send an email:
Configure the email settings in Administration → General
Change your profile settings to send a notification on certain events (change of status on an issue for example)
Trigger the event
Check the web.log file on your SQ instance, you should see the stack trace of the exception when trying to send the email.
Please let me know if you want to pursue this option and need more details.