diff options
author | Thomas Lehmann <t.lehmann@strato.de> | 2024-10-29 11:53:18 +0100 |
---|---|---|
committer | Thomas Lehmann <147605810+thlehmann-ionos@users.noreply.github.com> | 2024-11-19 11:32:39 +0100 |
commit | e4c013d86d0802865aa2bac8fdda354cd2642788 (patch) | |
tree | 0495717c88f55f1cc7f00789ef3ca91b001ce813 /lib/private | |
parent | 40211f3d0748983c294dcfffa56f4022bd69d28e (diff) | |
download | nextcloud-server-e4c013d86d0802865aa2bac8fdda354cd2642788.tar.gz nextcloud-server-e4c013d86d0802865aa2bac8fdda354cd2642788.zip |
feat(Mailer): add "null" SMTP transport mode
== Goal
Allow disabling mail delivery altogether.
== Usecase
If mails ought to be send by other means than rendering messages from
templates and sending them via SMTP-like protocols.
Example: listening to specific Nextcloud events and pass parameters to
a centralized (i.e. REST-based) API that sends e-mails.
Signed-off-by: Thomas Lehmann <t.lehmann@strato.de>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Mail/Mailer.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index b660ee0c02f..18636e183d0 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -27,6 +27,7 @@ use Psr\Log\LoggerInterface; use Symfony\Component\Mailer\Exception\TransportExceptionInterface; use Symfony\Component\Mailer\Mailer as SymfonyMailer; use Symfony\Component\Mailer\MailerInterface; +use Symfony\Component\Mailer\Transport\NullTransport; use Symfony\Component\Mailer\Transport\SendmailTransport; use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; use Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream; @@ -256,6 +257,9 @@ class Mailer implements IMailer { } switch ($this->config->getSystemValueString('mail_smtpmode', 'smtp')) { + case 'null': + $transport = new NullTransport(); + break; case 'sendmail': $transport = $this->getSendMailInstance(); break; |