diff --git a/core/src/main/java/google/registry/config/RegistryConfig.java b/core/src/main/java/google/registry/config/RegistryConfig.java index e82a273aa..4100c7f3d 100644 --- a/core/src/main/java/google/registry/config/RegistryConfig.java +++ b/core/src/main/java/google/registry/config/RegistryConfig.java @@ -894,9 +894,9 @@ public final class RegistryConfig { * @see google.registry.reporting.spec11.Spec11EmailUtils */ @Provides - @Config("spec11ReplyToEmailAddress") - public static InternetAddress provideSpec11ReplyToEmailAddress(RegistryConfigSettings config) { - return parseEmailAddress(config.misc.spec11ReplyToEmailAddress); + @Config("spec11OutgoingEmailAddress") + public static InternetAddress provideSpec11OutgoingEmailAddress(RegistryConfigSettings config) { + return parseEmailAddress(config.misc.spec11OutgoingEmailAddress); } /** diff --git a/core/src/main/java/google/registry/config/RegistryConfigSettings.java b/core/src/main/java/google/registry/config/RegistryConfigSettings.java index a6894627e..7392d341d 100644 --- a/core/src/main/java/google/registry/config/RegistryConfigSettings.java +++ b/core/src/main/java/google/registry/config/RegistryConfigSettings.java @@ -173,7 +173,7 @@ public class RegistryConfigSettings { public static class Misc { public String sheetExportId; public String alertRecipientEmailAddress; - public String spec11ReplyToEmailAddress; + public String spec11OutgoingEmailAddress; public int asyncDeleteDelaySeconds; public int transientFailureRetries; } diff --git a/core/src/main/java/google/registry/config/files/default-config.yaml b/core/src/main/java/google/registry/config/files/default-config.yaml index 61e7fa617..09f7ec9dd 100644 --- a/core/src/main/java/google/registry/config/files/default-config.yaml +++ b/core/src/main/java/google/registry/config/files/default-config.yaml @@ -357,9 +357,9 @@ misc: # Address we send alert summary emails to. alertRecipientEmailAddress: email@example.com - # Address to which the Spec 11 emails to registrars should be replied. This needs - # to be a deliverable email address in case the registrars want to contact us. - spec11ReplyToEmailAddress: reply-to@example.com + # Address from which Spec 11 emails to registrars are sent. This needs + # to be a deliverable email address to handle replies from registrars as well. + spec11OutgoingEmailAddress: abuse@example.com # How long to delay processing of asynchronous deletions. This should always # be longer than eppResourceCachingSeconds, to prevent deleted contacts or diff --git a/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java b/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java index 01574fa9c..9b124ca73 100644 --- a/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java +++ b/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java @@ -59,22 +59,19 @@ public class Spec11EmailUtils { private final SendEmailService emailService; private final InternetAddress outgoingEmailAddress; private final InternetAddress alertRecipientAddress; - private final InternetAddress spec11ReplyToAddress; private final ImmutableList spec11WebResources; private final String registryName; @Inject Spec11EmailUtils( SendEmailService emailService, - @Config("gSuiteOutgoingEmailAddress") InternetAddress outgoingEmailAddress, @Config("alertRecipientEmailAddress") InternetAddress alertRecipientAddress, - @Config("spec11ReplyToEmailAddress") InternetAddress spec11ReplyToAddress, + @Config("spec11OutgoingEmailAddress") InternetAddress spec11OutgoingEmailAddress, @Config("spec11WebResources") ImmutableList spec11WebResources, @Config("registryName") String registryName) { this.emailService = emailService; - this.outgoingEmailAddress = outgoingEmailAddress; + this.outgoingEmailAddress = spec11OutgoingEmailAddress; this.alertRecipientAddress = alertRecipientAddress; - this.spec11ReplyToAddress = spec11ReplyToAddress; this.spec11WebResources = spec11WebResources; this.registryName = registryName; } @@ -149,7 +146,7 @@ public class Spec11EmailUtils { .setContentType(MediaType.HTML_UTF_8) .setFrom(outgoingEmailAddress) .addRecipient(getEmailAddressForRegistrar(registrarThreatMatches.clientId())) - .setBcc(spec11ReplyToAddress) + .setBcc(outgoingEmailAddress) .build()); } @@ -172,7 +169,7 @@ public class Spec11EmailUtils { ImmutableMap.of( "date", date.toString(), "registry", registryName, - "replyToEmail", spec11ReplyToAddress.getAddress(), + "replyToEmail", outgoingEmailAddress.getAddress(), "threats", threatMatchMap, "resources", spec11WebResources); renderer.setData(data); diff --git a/core/src/test/java/google/registry/reporting/spec11/Spec11EmailUtilsTest.java b/core/src/test/java/google/registry/reporting/spec11/Spec11EmailUtilsTest.java index 1b0ba4dd7..637159596 100644 --- a/core/src/test/java/google/registry/reporting/spec11/Spec11EmailUtilsTest.java +++ b/core/src/test/java/google/registry/reporting/spec11/Spec11EmailUtilsTest.java @@ -87,7 +87,7 @@ public class Spec11EmailUtilsTest { + "update your abuse contact using your registrar portal account.

" + "" + "

If you have any questions regarding this notice, please contact " - + "my-reply-to@test.com.

"; + + "abuse@test.com.

"; private static final String MONTHLY_EMAIL_FORMAT = "Dear registrar partner," + "" @@ -117,7 +117,7 @@ public class Spec11EmailUtilsTest { + "our monthly reporting.

" + "" + "

If you have any questions regarding this notice, please contact " - + "my-reply-to@test.com.

"; + + "abuse@test.com.

"; @Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build(); @@ -139,9 +139,8 @@ public class Spec11EmailUtilsTest { emailUtils = new Spec11EmailUtils( emailService, - new InternetAddress("my-sender@test.com"), new InternetAddress("my-receiver@test.com"), - new InternetAddress("my-reply-to@test.com"), + new InternetAddress("abuse@test.com"), FAKE_RESOURCES, "Super Cool Registry"); @@ -164,17 +163,17 @@ public class Spec11EmailUtilsTest { List capturedContents = contentCaptor.getAllValues(); validateMessage( capturedContents.get(0), - "my-sender@test.com", + "abuse@test.com", "the.registrar@example.com", - Optional.of("my-reply-to@test.com"), + Optional.of("abuse@test.com"), "Super Cool Registry Monthly Threat Detector [2018-07-15]", String.format(MONTHLY_EMAIL_FORMAT, "a.comMALWARE"), Optional.of(MediaType.HTML_UTF_8)); validateMessage( capturedContents.get(1), - "my-sender@test.com", + "abuse@test.com", "new.registrar@example.com", - Optional.of("my-reply-to@test.com"), + Optional.of("abuse@test.com"), "Super Cool Registry Monthly Threat Detector [2018-07-15]", String.format( MONTHLY_EMAIL_FORMAT, @@ -182,7 +181,7 @@ public class Spec11EmailUtilsTest { Optional.of(MediaType.HTML_UTF_8)); validateMessage( capturedContents.get(2), - "my-sender@test.com", + "abuse@test.com", "my-receiver@test.com", Optional.empty(), "Spec11 Pipeline Success 2018-07-15", @@ -202,17 +201,17 @@ public class Spec11EmailUtilsTest { List capturedMessages = contentCaptor.getAllValues(); validateMessage( capturedMessages.get(0), - "my-sender@test.com", + "abuse@test.com", "the.registrar@example.com", - Optional.of("my-reply-to@test.com"), + Optional.of("abuse@test.com"), "Super Cool Registry Daily Threat Detector [2018-07-15]", String.format(DAILY_EMAIL_FORMAT, "a.comMALWARE"), Optional.of(MediaType.HTML_UTF_8)); validateMessage( capturedMessages.get(1), - "my-sender@test.com", + "abuse@test.com", "new.registrar@example.com", - Optional.of("my-reply-to@test.com"), + Optional.of("abuse@test.com"), "Super Cool Registry Daily Threat Detector [2018-07-15]", String.format( DAILY_EMAIL_FORMAT, @@ -220,7 +219,7 @@ public class Spec11EmailUtilsTest { Optional.of(MediaType.HTML_UTF_8)); validateMessage( capturedMessages.get(2), - "my-sender@test.com", + "abuse@test.com", "my-receiver@test.com", Optional.empty(), "Spec11 Pipeline Success 2018-07-15", @@ -247,15 +246,15 @@ public class Spec11EmailUtilsTest { List capturedContents = contentCaptor.getAllValues(); validateMessage( capturedContents.get(0), - "my-sender@test.com", + "abuse@test.com", "new.registrar@example.com", - Optional.of("my-reply-to@test.com"), + Optional.of("abuse@test.com"), "Super Cool Registry Monthly Threat Detector [2018-07-15]", String.format(MONTHLY_EMAIL_FORMAT, "c.comMALWARE"), Optional.of(MediaType.HTML_UTF_8)); validateMessage( capturedContents.get(1), - "my-sender@test.com", + "abuse@test.com", "my-receiver@test.com", Optional.empty(), "Spec11 Pipeline Success 2018-07-15", @@ -292,17 +291,17 @@ public class Spec11EmailUtilsTest { List capturedMessages = contentCaptor.getAllValues(); validateMessage( capturedMessages.get(0), - "my-sender@test.com", + "abuse@test.com", "the.registrar@example.com", - Optional.of("my-reply-to@test.com"), + Optional.of("abuse@test.com"), "Super Cool Registry Monthly Threat Detector [2018-07-15]", String.format(MONTHLY_EMAIL_FORMAT, "a.comMALWARE"), Optional.of(MediaType.HTML_UTF_8)); validateMessage( capturedMessages.get(1), - "my-sender@test.com", + "abuse@test.com", "new.registrar@example.com", - Optional.of("my-reply-to@test.com"), + Optional.of("abuse@test.com"), "Super Cool Registry Monthly Threat Detector [2018-07-15]", String.format( MONTHLY_EMAIL_FORMAT, @@ -310,7 +309,7 @@ public class Spec11EmailUtilsTest { Optional.of(MediaType.HTML_UTF_8)); validateMessage( capturedMessages.get(2), - "my-sender@test.com", + "abuse@test.com", "my-receiver@test.com", Optional.empty(), "Spec11 Emailing Failure 2018-07-15", @@ -324,7 +323,7 @@ public class Spec11EmailUtilsTest { verify(emailService).sendEmail(contentCaptor.capture()); validateMessage( contentCaptor.getValue(), - "my-sender@test.com", + "abuse@test.com", "my-receiver@test.com", Optional.empty(), "Spec11 Pipeline Alert: 2018-07",