SonarQube code smell on javax.mail.internet.MimeMessage - Not find properties : 'mail.smtp.auth = true'

95 Views Asked by At

i'm working on a Springboot project where I need to send some emails. This is part of the code:

import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
.
.
.
.
try {
  Properties prop = System.getProperties();
  prop.put("mail.smtp.auth", "true");

  Session session = Session.getInstance(prop, null);
  Message msg = new MimeMessage(session);
  .
  .
  .
}


when running a sonarqube analysis, I get this error with Sonar 8.9.6: enter image description here

I really cannot undesrtand how this is possible since, in an other branch, I have the exact same code and the issue is not arised. the issue is blocker and so is preventing me to pass quality gate.

Any ideas?

0

There are 0 best solutions below