Program: 58975
Project: 58975
Buggy source:
protected void sendByEmail(Message message) throws MessagingException, IOException {
  MailAccount mailAccount=message.getMailAccount();
  if (mailAccount != null && message.getMediaTypeSelect() == 2) {
    String port=mailAccount.getPort() <= 0 ? null : mailAccount.getPort().toString();
    com.axelor.mail.MailAccount account=new SmtpAccount(mailAccount.getHost(),port,mailAccount.getLogin(),mailAccount.getPassword(),mailAccountService.getSmtpSecurity(mailAccount));
    MailSender sender=new MailSender(account);
    List<String> toRecipients=this.getEmailAddresses(message.getToEmailAddressSet());
    List<String> ccRecipients=this.getEmailAddresses(message.getCcEmailAddressSet());
    List<String> bccRecipients=this.getEmailAddresses(message.getBccEmailAddressSet());
    MailBuilder mailBuilder=sender.compose();
    mailBuilder.subject(message.getSubject());
    mailBuilder.from(message.getSenderUser().getName());
    LOG.debug("String_Node_Str",message.getSenderUser().getName());
    if (message.getFromEmailAddress() != null) {
      mailBuilder.replyTo(message.getFromEmailAddress().getAddress());
    }
    if (!Strings.isNullOrEmpty(message.getContent())) {
      mailBuilder.html(message.getContent());
    }
    if (!Strings.isNullOrEmpty(message.getFilePath())) {
      mailBuilder.attach("String_Node_Str",message.getFilePath());
    }
    if (toRecipients != null && !toRecipients.isEmpty()) {
      mailBuilder.to(Joiner.on("String_Node_Str").join(toRecipients));
    }
    if (ccRecipients != null && !ccRecipients.isEmpty()) {
      mailBuilder.cc(Joiner.on("String_Node_Str").join(ccRecipients));
    }
    if (bccRecipients != null && !bccRecipients.isEmpty()) {
      mailBuilder.bcc(Joiner.on("String_Node_Str").join(bccRecipients));
    }
    mailBuilder.send();
    message.setSentByEmail(true);
    message.setStatusSelect(MessageRepository.STATUS_SENT);
    message.setSentDateT(LocalDateTime.now());
    save(message);
  }
}

Fixed version (ground truth):
protected void sendByEmail(Message message) throws MessagingException, IOException {
  MailAccount mailAccount=message.getMailAccount();
  if (mailAccount != null && message.getMediaTypeSelect() == MEDIA_TYPE_EMAIL) {
    String port=mailAccount.getPort() <= 0 ? null : mailAccount.getPort().toString();
    com.axelor.mail.MailAccount account=new SmtpAccount(mailAccount.getHost(),port,mailAccount.getLogin(),mailAccount.getPassword(),mailAccountService.getSmtpSecurity(mailAccount));
    MailSender sender=new MailSender(account);
    List<String> toRecipients=this.getEmailAddresses(message.getToEmailAddressSet());
    List<String> ccRecipients=this.getEmailAddresses(message.getCcEmailAddressSet());
    List<String> bccRecipients=this.getEmailAddresses(message.getBccEmailAddressSet());
    MailBuilder mailBuilder=sender.compose();
    mailBuilder.subject(message.getSubject());
    mailBuilder.from(message.getSenderUser().getName());
    LOG.debug("String_Node_Str",message.getSenderUser().getName());
    if (message.getFromEmailAddress() != null) {
      mailBuilder.replyTo(message.getFromEmailAddress().getAddress());
    }
    if (!Strings.isNullOrEmpty(message.getContent())) {
      mailBuilder.html(message.getContent());
    }
    if (!Strings.isNullOrEmpty(message.getFilePath())) {
      mailBuilder.attach("String_Node_Str",message.getFilePath());
    }
    if (toRecipients != null && !toRecipients.isEmpty()) {
      mailBuilder.to(Joiner.on("String_Node_Str").join(toRecipients));
    }
    if (ccRecipients != null && !ccRecipients.isEmpty()) {
      mailBuilder.cc(Joiner.on("String_Node_Str").join(ccRecipients));
    }
    if (bccRecipients != null && !bccRecipients.isEmpty()) {
      mailBuilder.bcc(Joiner.on("String_Node_Str").join(bccRecipients));
    }
    mailBuilder.send();
    message.setSentByEmail(true);
    message.setStatusSelect(MessageRepository.STATUS_SENT);
    message.setSentDateT(LocalDateTime.now());
    save(message);
  }
}