aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Mail
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2021-05-31 14:43:14 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2021-05-31 15:04:00 +0200
commit747325fc435cd0d295ba495507facd0bc145d086 (patch)
tree4355df8b0c0476cdf573a14f9a85a2b8f9aecdcd /lib/private/Mail
parent719430559f1a1f28800a9a26d4a5492aae046730 (diff)
downloadnextcloud-server-747325fc435cd0d295ba495507facd0bc145d086.tar.gz
nextcloud-server-747325fc435cd0d295ba495507facd0bc145d086.zip
Set local domain for swiftmailer transport
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib/private/Mail')
-rw-r--r--lib/private/Mail/Mailer.php11
1 files changed, 10 insertions, 1 deletions
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;
}