From 747325fc435cd0d295ba495507facd0bc145d086 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Mon, 31 May 2021 14:43:14 +0200 Subject: Set local domain for swiftmailer transport Signed-off-by: Daniel Kesselberg --- lib/private/Mail/Mailer.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index e31784db587..68088920248 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -45,11 +45,11 @@ use OCP\IL10N; use OCP\ILogger; use OCP\IURLGenerator; use OCP\L10N\IFactory; +use OCP\Mail\Events\BeforeMessageSent; use OCP\Mail\IAttachment; use OCP\Mail\IEMailTemplate; use OCP\Mail\IMailer; use OCP\Mail\IMessage; -use OCP\Mail\Events\BeforeMessageSent; /** * Class Mailer provides some basic functions to create a mail message that can be used in combination with @@ -293,6 +293,15 @@ class Mailer implements IMailer { $transport->setStreamOptions($streamingOptions); } + $overwriteCliUrl = parse_url( + $this->config->getSystemValueString('overwrite.cli.url', ''), + PHP_URL_HOST + ); + + if (!empty($overwriteCliUrl)) { + $transport->setLocalDomain($overwriteCliUrl); + } + return $transport; } -- cgit v1.2.3