From 7a9f4fbbbeb413d96bf71e953886c1b6b5639bca Mon Sep 17 00:00:00 2001 From: Bennet Becker Date: Thu, 22 Dec 2022 13:37:58 +0100 Subject: [PATCH] Setting Auto-Submitted header for calendar events and new user mail Signed-off-by: Bennet Becker --- .../lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php | 2 ++ apps/settings/lib/Mailer/NewUserMailHelper.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php index c2e68605d17..23e8ffc7e99 100644 --- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php +++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php @@ -36,6 +36,7 @@ use OCP\IConfig; use OCP\IL10N; use OCP\IURLGenerator; use OCP\L10N\IFactory as L10NFactory; +use OCP\Mail\AutoSubmittedValue; use OCP\Mail\IEMailTemplate; use OCP\Mail\IMailer; use OCP\IUser; @@ -131,6 +132,7 @@ class EmailProvider extends AbstractProvider { } $message->setTo([$emailAddress]); $message->useTemplate($template); + $message->setAutoSubmitted(AutoSubmittedValue::AUTO_GENERATED); try { $failed = $this->mailer->send($message); diff --git a/apps/settings/lib/Mailer/NewUserMailHelper.php b/apps/settings/lib/Mailer/NewUserMailHelper.php index 50502ed1d39..5da1082455e 100644 --- a/apps/settings/lib/Mailer/NewUserMailHelper.php +++ b/apps/settings/lib/Mailer/NewUserMailHelper.php @@ -35,6 +35,7 @@ use OCP\IConfig; use OCP\IURLGenerator; use OCP\IUser; use OCP\L10N\IFactory; +use OCP\Mail\AutoSubmittedValue; use OCP\Mail\IEMailTemplate; use OCP\Mail\IMailer; use OCP\Security\ICrypto; @@ -181,6 +182,7 @@ class NewUserMailHelper { $message->setTo([$email => $user->getDisplayName()]); $message->setFrom([$this->fromAddress => $this->themingDefaults->getName()]); $message->useTemplate($emailTemplate); + $message->setAutoSubmitted(AutoSubmittedValue::AUTO_GENERATED); $this->mailer->send($message); } } -- 2.39.5