3

SonarQube's SMTP settings can be changed in the web UI.

How can I set those SMTP settings in the sonar.properties configuration file?

slartidan
  • 20,403
  • 15
  • 83
  • 131
Sam
  • 191
  • 4
  • 16

1 Answers1

4

You can also use sonar.properties to define the smtp settings. But this approach is not recommended and therefore barely documented.

However, there is a little of documentation in the sources.

An example:

email.smtp_host.secured=my.smtp.server
email.smtp_port.secured=9918
email.smtp_secure_connection.secured=true
email.smtp_username.secured=slartidan
email.smtp_password.secured=password123
email.from=slartidan@example.com
email.prefix=[SONARQUBE] Important:
slartidan
  • 20,403
  • 15
  • 83
  • 131
  • Thanks for your response. can you please show some configuration for reference.@slartidan – Sam Aug 17 '17 at 15:45
  • @Sam I added an example (untested) – slartidan Aug 18 '17 at 09:44
  • Thanks, I tried with the values you provided, after giving all config for these attributes I can able to see only smtp port and prefix is the only value passed from sonar.properties to sonarqube UI. Values for hostname and username doesn't get passed from sonar.properties to UI. My sonarqube version is 5.6.6 is there any modifications I need to proide? – Sam Aug 21 '17 at 21:16
  • Have you had any success? It seems to be a bug, I found this discussion as well: https://groups.google.com/d/topic/sonarqube/aAFPS2KpuY8/discussion – Stephan Feb 15 '18 at 11:05
  • Why is it not recommended? Seems best practice for me for modern approaches like infrastructure as code, that explicitly avoids manual changes. – Daniel Sep 26 '19 at 12:03