Email notifications not trigerred when new quality issues are detected

Hello SonarSource team,

I’m reaching out because I’m experiencing an issue with email notifications in SonarQube Community Build.
I’m trying to configure email notifications as described in your official documentation :

1- Environment :

  • Product : SonarQube Community Build

  • Version : 26.7.0.124771

2- SMTP Configuration :

First, Iconfigured the SMTP server through the SonarQube Admin interface.

I Also used the built-in test functionality to verify the SMTP configuration and email delivery.

The test was successful, and I correctly received the test notification email. This confirms that the SMTP server configured is working properly.

3- Steps to reproduce :

However, I encountered an issue when testing notifications in a real-world scenario.

Here are the steps I follewed :

  • Create a new project in SonarQube
  • Go to My Account > Notifications and activate Notifications for this project (I also activated all the notifications pannel)

  • Run an initial Analysis with no source code files
  • Add a source code file containing several known quality issues (see the example below)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core">
        
        <f:metadata>
                <f:viewParam name="user" value="#{userEdit.user}" converter="#{userConvertor}" />
                <f:event listener="#{userEdit.preRenderView()}" type="preRenderView"/>
        </f:metadata>
        
        <h:head>
                <title>User list</title>
        </h:head>
        
        <h:body>
                
                <li>Apple</li>
                <li>Strawberry</li>

                <h:messages />
                
                <h:form>
                        
                        <h:panelGrid columns="2">
                                <f:facet name="header">User</f:facet>
                                
                                <h:outputLabel value="Id" rendered="#{!empty userEdit.user.id}" />
                                <h:outputLabel value="#{userEdit.user.id}" rendered="#{!empty userEdit.user.id}" />
                                        
                                <h:outputLabel for="firstName" value="First name" />
                                <h:inputText id="firstName" value="#{userEdit.user.firstName}" label="First name" />
                                
                                <h:outputLabel for="lastName" value="Last name" />
                                <h:inputText id="lastName" value="#{userEdit.user.lastName}" label="Last name"  />
                                
                                <h:outputLabel for="birthDay" value="Birth day" />
                                <h:inputText id="birthDay" value="#{userEdit.user.birthday}" label="Birth day">
                                        <f:convertDateTime pattern="dd-MM-yyyy"/>
                                </h:inputText>
                                
                                <h:outputLabel for="email" value="Email" />
                                <h:inputText id="email" value="#{userEdit.user.email}" />
                        
                                <h:commandButton action="#{userEdit.saveUser}" value="Submit" />
                                <h:button outcome="index.xhtml" value="Cancel"  />
                        </h:panelGrid>
                </h:form>
        
        </h:body>
</html>
  • Run a second analysis of the project
  • Check the project dashboard to see the new issues (correctly assigned to me)

After the second analysis, the newly aded source file is correctly displayed in the interface, and all the expected quality issues are detected and assigned to me.

However, no email notification is send to me. I also checked my spam and junk mail folders, but nothing.

I also tested notifications triggered by issue status changes by marking an issue as False positive and Accepted. However, once again, no email notification was received.

Is this behavior expedted in SonarQube Community Build ? Did I miss something?

4- Working case :

However, I did identify one scenario where email notifications work as expected : when a change occurs in the Quality Gate status for, an email notification is successfully received.

Thak you in advance for your help and any clarification you can provide.

Kind regards,

Usine Logicielle

Hey @Usinelogicielle,

I would expect the “My new issues” notification to fire, indeed. Just to confirm: the issues that are being detected are categorized as “new issues”, right? In other words: they should be issues on new code, not on overall code. From the reproduction workflow you described, I understand that this is the case, but just wanted to double-check.

In any case, the way to troubleshoot this would be with debug-level server logs. Could you please set the logs level to DEBUG (Administration > System), reproduce your issue, set log level back to INFO, and check ce.log for the background task that sends the notifications? You probably want to look for a log like Send issue notifications | newIssuesNotifs=... | myNewIssuesNotifs=... | changesNotifs=....

By the way:

I also tested notifications triggered by issue status changes by marking an issue as False positive and Accepted. However, once again, no email notification was received.

This won’t notify you - the “Changes in issues/hotspots assigned to me” notification only fires when a different user changes the issue, not you.