RED-6903 - Adjust failure message to allow different username and from email

This commit is contained in:
Andrei Isvoran 2023-09-20 11:18:54 +02:00 committed by Kilian Schüttler
parent 979e9069fa
commit 6fbfbb17ce
2 changed files with 0 additions and 16 deletions

View File

@ -57,9 +57,6 @@ public class EmailService {
if (auth) {
props.setProperty("mail.smtp.auth", "true");
if (!config.get("user").equals(address)) {
throw new BadRequestException("User and from email should be the same");
}
}
if (ssl) {

View File

@ -55,19 +55,6 @@ public class SMTPConfigurationTest extends AbstractTenantUserManagementIntegrati
TenantContext.clear();
}
@Test
public void testSMTPConnectionWithDifferentEmails() {
TenantContext.setTenantId(AbstractTenantUserManagementIntegrationTest.TEST_TENANT_ID);
SMTPConfiguration smtpConfiguration = provideTestSMTPConfiguration();
smtpConfiguration.setUser("invalid");
assertThatThrownBy(() -> smtpConfigurationClient.testSMTPConfiguration(smtpConfiguration)).hasMessageContaining("User and from email should be the same");
TenantContext.clear();
}
private SMTPConfiguration provideTestSMTPConfiguration() {
SMTPConfiguration smtpConfiguration = new SMTPConfiguration();