Skip to content

Commit

Permalink
remove fallback header modification
Browse files Browse the repository at this point in the history
Signed-off-by: Bennet Becker <dev@bennet.cc>
  • Loading branch information
bennet0496 committed Jan 3, 2023
1 parent ee71841 commit 1e674d5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/MailQueueHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserManager;
use OCP\L10N\IFactory;
use OCP\L10N\IFactory;
use OCP\Mail\IMailer;
use OCP\Mail\Headers\AutoSubmitted;
use OCP\RichObjectStrings\InvalidObjectExeption;
use OCP\RichObjectStrings\IValidator;
use OCP\Util;
Expand Down Expand Up @@ -411,11 +412,8 @@ protected function sendEmailToUser($userName, $email, $lang, $timezone, $maxTime
$message->useTemplate($template);
$message->setFrom([$this->getSenderData('email') => $this->getSenderData('name')]);

if(method_exists($message, 'setAutoSubmitted')){
$message->setAutoSubmitted(\OCP\Mail\AutoSubmittedValue::AUTO_GENERATED);
} else {
$message->getSwiftMessage()->getHeaders()->addTextHeader('Auto-Submitted', 'auto-generated');
}
// We don't want auto generated responses to autogenerated activity notifications
$message->setAutoSubmitted(AutoSubmitted::VALUE_AUTO_GENERATED);

try {
$this->mailer->send($message);
Expand Down

0 comments on commit 1e674d5

Please sign in to comment.