Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/files_sharing/lib/SharesReminderJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use OCP\IUserManager;
use OCP\L10N\IFactory;
use OCP\Mail\EMailDetails;
use OCP\Mail\Headers\AutoSubmitted;
use OCP\Mail\IEMailTemplate;
use OCP\Mail\IMailer;
use OCP\Share\Exceptions\ShareNotFound;
Expand Down Expand Up @@ -270,6 +271,7 @@ private function sendReminder(array $reminderInfo): void {
$message->setFrom($from);
$message->setTo([$reminderInfo['email']]);
$message->useTemplate($emailTemplate);
$message->setAutoSubmitted(AutoSubmitted::VALUE_AUTO_GENERATED);
$errorText = "Sending email with share reminder to $reminderInfo[email] failed.";
try {
$failedRecipients = $this->mailer->send($message);
Expand Down
3 changes: 3 additions & 0 deletions apps/settings/lib/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use OCP\L10N\IFactory;
use OCP\Mail\EMailDetails;
use OCP\Mail\IEMailTemplate;
use OCP\Mail\Headers\AutoSubmitted;
use OCP\Mail\IMailer;
use OCP\User\Events\PasswordUpdatedEvent;
use OCP\User\Events\UserChangedEvent;
Expand Down Expand Up @@ -119,6 +120,7 @@ public function onChangePassword(PasswordUpdatedEvent $handle): void {
$message = $this->mailer->createMessage();
$message->setTo([$user->getEMailAddress() => $user->getDisplayName()]);
$message->useTemplate($template);
$message->setAutoSubmitted(AutoSubmitted::VALUE_AUTO_GENERATED);
$this->mailer->send($message);
}
}
Expand Down Expand Up @@ -199,6 +201,7 @@ public function onChangeEmail(UserChangedEvent $handle): void {
$message = $this->mailer->createMessage();
$message->setTo([$oldMailAddress => $user->getDisplayName()]);
$message->useTemplate($template);
$message->setAutoSubmitted(AutoSubmitted::VALUE_AUTO_GENERATED);
$this->mailer->send($message);
}
}
Expand Down
2 changes: 2 additions & 0 deletions core/BackgroundJobs/CheckCodeIntegrityJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\L10N\IFactory;
use OCP\Mail\Headers\AutoSubmitted;
use OCP\Mail\IEMailTemplate;
use OCP\Mail\IMailer;
use OCP\Notification\IManager as INotificationManager;
Expand Down Expand Up @@ -208,6 +209,7 @@ private function sendMail(IUser $admin, array $summary): void {
$message = $this->mailer->createMessage();
$message->setTo([$email => $admin->getDisplayName()]);
$message->useTemplate($template);
$message->setAutoSubmitted(AutoSubmitted::VALUE_AUTO_GENERATED);

try {
$this->mailer->send($message);
Expand Down
2 changes: 2 additions & 0 deletions core/Controller/LostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use OCP\IUser;
use OCP\IUserManager;
use OCP\Log\Audit\CriticalActionPerformedEvent;
use OCP\Mail\Headers\AutoSubmitted;
use OCP\Mail\IMailer;
use OCP\PreConditionNotMetException;
use OCP\Security\VerificationToken\InvalidTokenException;
Expand Down Expand Up @@ -279,6 +280,7 @@ protected function sendEmail(string $input): void {
$message->setTo([$email => $user->getDisplayName()]);
$message->setFrom([$this->defaultMailAddress => $this->defaults->getName()]);
$message->useTemplate($emailTemplate);
$message->setAutoSubmitted(AutoSubmitted::VALUE_AUTO_GENERATED);
$this->mailer->send($message);
} catch (Exception $e) {
// Log the exception and continue
Expand Down
6 changes: 6 additions & 0 deletions lib/private/Accounts/AccountManager.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
Expand Down Expand Up @@ -31,6 +32,7 @@
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\L10N\IFactory;
use OCP\Mail\Headers\AutoSubmitted;
use OCP\Mail\IMailer;
use OCP\Security\ICrypto;
use OCP\Security\VerificationToken\IVerificationToken;
Expand Down Expand Up @@ -337,6 +339,7 @@ protected function sendEmailVerificationEmail(IUser $user, string $email): bool
$message->setTo([$email => $user->getDisplayName()]);
$message->setFrom([Util::getDefaultEmailAddress('verification-noreply') => $this->defaults->getName()]);
$message->useTemplate($emailTemplate);
$message->setAutoSubmitted(AutoSubmitted::VALUE_AUTO_GENERATED);
$this->mailer->send($message);
} catch (Exception $e) {
// Log the exception and continue
Expand Down Expand Up @@ -792,6 +795,9 @@ private function sanitizePropertyFediverse(IAccountProperty $property): void {
if (is_resource($data)) {
$data = stream_get_contents($data);
}
if ($data === false) {
throw new InvalidArgumentException();
}
$decoded = json_decode($data, true);
// ensure the username is the same the user passed
// in this case we can assume this is a valid fediverse server and account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use OCP\IUser;
use OCP\IUserManager;
use OCP\L10N\IFactory as IL10nFactory;
use OCP\Mail\Headers\AutoSubmitted;
use OCP\Mail\IEMailTemplate;
use OCP\Mail\IMailer;
use OCP\Mail\IMessage;
Expand Down Expand Up @@ -117,6 +118,7 @@ private function getWipingStartedMessage(RemoteWipeStarted $event, IUser $user):
$emailTemplate->addFooter();
$message->setTo([$user->getEMailAddress()]);
$message->useTemplate($emailTemplate);
$message->setAutoSubmitted(AutoSubmitted::VALUE_AUTO_GENERATED);

return $message;
}
Expand Down Expand Up @@ -148,6 +150,7 @@ private function getWipingFinishedMessage(RemoteWipeFinished $event, IUser $user
$emailTemplate->addFooter();
$message->setTo([$user->getEMailAddress()]);
$message->useTemplate($emailTemplate);
$message->setAutoSubmitted(AutoSubmitted::VALUE_AUTO_GENERATED);

return $message;
}
Expand Down
Loading