Enhance logging for mail verification details

Updated logging to provide more detailed information about user credentials and email actions. This helps in debugging and monitoring mail verification processes more effectively. Adjusted trace messages to include username and password for better traceability.
This commit is contained in:
Teriuihi 2024-08-05 01:03:12 +02:00
parent cbb5dd99d8
commit 14f02e535f

View File

@ -25,7 +25,7 @@ public class Verify {
return CompletableFuture.completedFuture(VerificationResult.NO_MAIL_ACCOUNT);
}
PasswordAuthentication passwordAuthentication = accountDetails.get();
logger.trace("accountDetails: {}", passwordAuthentication);
logger.trace("accountDetails: user {} pass {}", passwordAuthentication.getUserName(), passwordAuthentication.getPassword());
Session session = MailSettings.getSession(mailProperties, passwordAuthentication);
//TODO rate limit sending mail from IP and to specific e-mail addresses (max 1 per minute and max 10 per day)
@ -34,7 +34,7 @@ public class Verify {
logger.trace("Creating mail");
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(passwordAuthentication.getUserName()));
logger.trace("Set from");
logger.trace("Set from to {}", passwordAuthentication.getUserName());
message.setRecipients(
Message.RecipientType.TO,
InternetAddress.parse(address)