From dde5c46a3eb7c6dcee47795590619ccd393577d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?=
Date: Mon, 20 Dec 2021 11:35:06 +0100
Subject: [PATCH 1/2] Migrate to Symfony Mailer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Côme Chilliet
---
3rdparty | 2 +-
apps/dav/lib/CalDAV/Schedule/IMipPlugin.php | 7 +-
.../lib/Controller/MailSettingsController.php | 2 -
apps/settings/lib/Settings/Admin/Mail.php | 1 -
.../settings/admin/additional-mail.php | 33 +-
.../Controller/MailSettingsControllerTest.php | 4 -
.../tests/Settings/Admin/MailTest.php | 2 -
config/config.sample.php | 23 +-
lib/private/Mail/Attachment.php | 36 +-
lib/private/Mail/Mailer.php | 172 ++++----
lib/private/Mail/Message.php | 188 ++++-----
lib/public/Mail/IMailer.php | 2 +-
tests/lib/Mail/MailerTest.php | 128 ++++--
tests/lib/Mail/MessageTest.php | 366 +++++++-----------
14 files changed, 480 insertions(+), 486 deletions(-)
diff --git a/3rdparty b/3rdparty
index 1d53ed4d32824..b31aba0505a3d 160000
--- a/3rdparty
+++ b/3rdparty
@@ -1 +1 @@
-Subproject commit 1d53ed4d3282427854fca7ee6ecbb945304272db
+Subproject commit b31aba0505a3daf84b016f52873794b618694dff
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
index be238ae5afbda..50390549570dc 100644
--- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
+++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
@@ -172,9 +172,14 @@ public function schedule(Message $iTipMessage) {
return;
}
- $senderName = $iTipMessage->senderName ?: null;
$recipientName = $iTipMessage->recipientName ?: null;
+ /** @var Parameter|string|null $senderName */
+ $senderName = $iTipMessage->senderName ?: null;
+ if($senderName instanceof Parameter) {
+ $senderName = $senderName->getValue() ?? null;
+ }
+
if ($senderName === null || empty(trim($senderName))) {
$senderName = $this->userManager->getDisplayName($this->userId);
}
diff --git a/apps/settings/lib/Controller/MailSettingsController.php b/apps/settings/lib/Controller/MailSettingsController.php
index 22c0622a0722d..2df79b6773133 100644
--- a/apps/settings/lib/Controller/MailSettingsController.php
+++ b/apps/settings/lib/Controller/MailSettingsController.php
@@ -85,7 +85,6 @@ public function __construct($appName,
* @param string $mail_smtpmode
* @param string $mail_smtpsecure
* @param string $mail_smtphost
- * @param string $mail_smtpauthtype
* @param int $mail_smtpauth
* @param string $mail_smtpport
* @return DataResponse
@@ -95,7 +94,6 @@ public function setMailSettings($mail_domain,
$mail_smtpmode,
$mail_smtpsecure,
$mail_smtphost,
- $mail_smtpauthtype,
$mail_smtpauth,
$mail_smtpport,
$mail_sendmailmode) {
diff --git a/apps/settings/lib/Settings/Admin/Mail.php b/apps/settings/lib/Settings/Admin/Mail.php
index f4c546b27a42f..1cdb7315713c6 100644
--- a/apps/settings/lib/Settings/Admin/Mail.php
+++ b/apps/settings/lib/Settings/Admin/Mail.php
@@ -61,7 +61,6 @@ public function getForm() {
'mail_smtpsecure' => $this->config->getSystemValue('mail_smtpsecure', ''),
'mail_smtphost' => $this->config->getSystemValue('mail_smtphost', ''),
'mail_smtpport' => $this->config->getSystemValue('mail_smtpport', ''),
- 'mail_smtpauthtype' => $this->config->getSystemValue('mail_smtpauthtype', ''),
'mail_smtpauth' => $this->config->getSystemValue('mail_smtpauth', false),
'mail_smtpname' => $this->config->getSystemValue('mail_smtpname', ''),
'mail_smtppassword' => $this->config->getSystemValue('mail_smtppassword', ''),
diff --git a/apps/settings/templates/settings/admin/additional-mail.php b/apps/settings/templates/settings/admin/additional-mail.php
index 6b85fcbe86753..6b31ebe879cfd 100644
--- a/apps/settings/templates/settings/admin/additional-mail.php
+++ b/apps/settings/templates/settings/admin/additional-mail.php
@@ -24,17 +24,9 @@
/** @var \OCP\IL10N $l */
/** @var array $_ */
-$mail_smtpauthtype = [
- '' => $l->t('None'),
- 'LOGIN' => $l->t('Login'),
- 'PLAIN' => $l->t('Plain'),
- 'NTLM' => $l->t('NT LAN Manager'),
-];
-
$mail_smtpsecure = [
'' => $l->t('None'),
- 'ssl' => $l->t('SSL/TLS'),
- 'tls' => $l->t('STARTTLS'),
+ 'ssl' => $l->t('SSL/TLS')
];
$mail_smtpmode = [
@@ -112,26 +104,7 @@
value="" />
-