From 81a54f51794e0711c6d6c748bbedfa517c6da6ed Mon Sep 17 00:00:00 2001 From: hongwei Date: Wed, 6 Aug 2025 17:09:10 +0200 Subject: [PATCH 1/4] refactor/remove commented-out Tesobe Mail Server configuration from sample.props.template --- .../src/main/resources/props/sample.props.template | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/obp-api/src/main/resources/props/sample.props.template b/obp-api/src/main/resources/props/sample.props.template index 639b2e72c..e430d6553 100644 --- a/obp-api/src/main/resources/props/sample.props.template +++ b/obp-api/src/main/resources/props/sample.props.template @@ -324,17 +324,6 @@ mail.exception.sender.address=no-reply@example.com ## Recipient addresses for exception notifications (comma-separated) mail.exception.registered.notification.addresses=notify@example.com,notify2@example.com,notify3@example.com -## Tesobe Mail Server: -## mail.smtp.host=mail.tesobe.com -## mail.smtp.port=25 -## mail.smtp.auth=true -## mail.smtp.user=your-email@tesobe.com -## mail.smtp.password=your-password -## mail.smtp.starttls.enable=true -## mail.smtp.ssl.enable=false -## mail.smtp.ssl.protocols=TLSv1.2 - - ## Oauth token timeout token_expiration_weeks=4 From 16e74f6089300c22331c0776a6dc41531636a077 Mon Sep 17 00:00:00 2001 From: hongwei Date: Wed, 6 Aug 2025 17:17:04 +0200 Subject: [PATCH 2/4] refactor/update email sender address in LocalMappedConnector to use dynamic configuration --- .../scala/code/bankconnectors/LocalMappedConnector.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala index 8b121c586..8c112f5ee 100644 --- a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala @@ -381,7 +381,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { APIUtil.getEmailsByUserId(userId) map { pair => val emailContent = CommonsEmailWrapper.EmailContent( - from = "challenge@tesobe.com", + from = mailUsersUserinfoSenderAddress, to = List(pair._2), subject = "Challenge", textContent = Some(s"Your OTP challenge : ${challengeAnswer}") @@ -5188,7 +5188,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { scaMethod match { case v if v == StrongCustomerAuthentication.EMAIL.toString => // Send the email val emailContent = CommonsEmailWrapper.EmailContent( - from = "challenge@tesobe.com", + from = mailUsersUserinfoSenderAddress, to = List(customer.email), subject = "Challenge request", textContent = Some(userAuthContextUpdate.challenge) @@ -5215,7 +5215,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { ): OBPReturnType[Box[String]] = { if (scaMethod == StrongCustomerAuthentication.EMAIL){ // Send the email val emailContent = CommonsEmailWrapper.EmailContent( - from = "challenge@tesobe.com", + from = mailUsersUserinfoSenderAddress, to = List(recipient), subject = "OBP Consent Challenge", textContent = Some(message) From 80d09907c213ad06c0f843d1cc0d19ab621799a6 Mon Sep 17 00:00:00 2001 From: hongwei Date: Wed, 6 Aug 2025 17:20:17 +0200 Subject: [PATCH 3/4] refactor/remove testMailHogConfig method from CommonsEmailWrapper to clean up unused code --- .../code/api/util/CommonsEmailWrapper.scala | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/obp-api/src/main/scala/code/api/util/CommonsEmailWrapper.scala b/obp-api/src/main/scala/code/api/util/CommonsEmailWrapper.scala index 27e486147..3b57e9747 100644 --- a/obp-api/src/main/scala/code/api/util/CommonsEmailWrapper.scala +++ b/obp-api/src/main/scala/code/api/util/CommonsEmailWrapper.scala @@ -209,31 +209,4 @@ object CommonsEmailWrapper extends MdcLoggable { attachment } - /** - * Test MailHog configuration - */ - def testMailHogConfig(): Unit = { - val config = EmailConfig( - smtpHost = "localhost", - smtpPort = 1025, - username = "", - password = "", - useTLS = false, - debug = true - ) - - val content = EmailContent( - from = "test@localhost", - to = List("receive@mailhog.local"), - subject = "Test MailHog with Apache Commons Email", - textContent = Some("This is a test email sent to MailHog using Apache Commons Email wrapper.") - ) - - logger.info("Testing MailHog configuration with Apache Commons Email...") - - sendTextEmail(config, content) match { - case Full(messageId) => logger.info(s"MailHog email sent successfully: $messageId") - case Empty => logger.error("Failed to send MailHog email") - } - } } \ No newline at end of file From 01e601a87faaac454615f0e9b5e65658a4049417 Mon Sep 17 00:00:00 2001 From: hongwei Date: Wed, 6 Aug 2025 17:53:56 +0200 Subject: [PATCH 4/4] refactor/update import statement for CannotCompileException to use javassist package --- obp-api/src/main/scala/code/api/util/APIUtil.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obp-api/src/main/scala/code/api/util/APIUtil.scala b/obp-api/src/main/scala/code/api/util/APIUtil.scala index db5049469..141538a1b 100644 --- a/obp-api/src/main/scala/code/api/util/APIUtil.scala +++ b/obp-api/src/main/scala/code/api/util/APIUtil.scala @@ -71,7 +71,7 @@ import code.util.{Helper, JsonSchemaUtil} import code.views.system.AccountAccess import code.views.{MapperViews, Views} import code.webuiprops.MappedWebUiPropsProvider.getWebUiPropsValue -import com.alibaba.ttl.internal.javassist.CannotCompileException +import javassist.CannotCompileException import com.github.dwickern.macros.NameOf.{nameOf, nameOfType} import com.openbankproject.commons.ExecutionContext.Implicits.global import com.openbankproject.commons.model._