From d4df22db3db5a30c285a5c40f69d70ceae17ff80 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 6 Feb 2021 11:31:27 +0100 Subject: Newsletter: Address to self. An empty To: header is rejected by WEB.DE. Therefore, adding a primary recipient is necessary even if no obvious one exists. This change makes the NewsletterSender's own address the primary recipient, circumventing the problem. Change-Id: I78febdd1f57b3f5737d83334972867ec9e4781d8 --- src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java index 7a52d32..8c8c9b6 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java @@ -37,6 +37,9 @@ public class NewsletterSender { @ConfigProperty(name = "mulkcms.newsletter.time-zone") ZoneId newsletterTimeZone; + @ConfigProperty(name = "quarkus.mailer.from") + String senderAddress; + @PersistenceContext EntityManager em; @CheckedTemplate @@ -100,6 +103,7 @@ public class NewsletterSender { var sendJob = mailText .subject(String.format("MulkCMS newsletter #%d", newsletterNumber)) + .to(senderAddress) .bcc(subscriberEmails) .send(); sendJob.toCompletableFuture().get(10000, TimeUnit.SECONDS); -- cgit v1.2.3