diff --git a/typo3/sysext/core/Classes/Compatibility/Slot/PostInitializeMailer.php b/typo3/sysext/core/Classes/Compatibility/Slot/PostInitializeMailer.php
deleted file mode 100644
index 207e2e86f662641d2f992d095420de2969e260d4..0000000000000000000000000000000000000000
--- a/typo3/sysext/core/Classes/Compatibility/Slot/PostInitializeMailer.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace TYPO3\CMS\Core\Compatibility\Slot;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Mail\Event\AfterMailerInitializationEvent;
-use TYPO3\CMS\Core\Mail\Mailer;
-use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
-
-/**
- * Bridge to provide backwards-compatibility for executing the SignalSlot dispatcher event.
- */
-class PostInitializeMailer
-{
-    /**
-     * @var Dispatcher
-     */
-    protected $dispatcher;
-
-    public function __construct(Dispatcher $dispatcher)
-    {
-        $this->dispatcher = $dispatcher;
-    }
-
-    public function __invoke(AfterMailerInitializationEvent $event): void
-    {
-        $this->dispatcher->dispatch(Mailer::class, 'postInitializeMailer', [$event->getMailer()]);
-    }
-}
diff --git a/typo3/sysext/core/Classes/Compatibility/SlotReplacement.php b/typo3/sysext/core/Classes/Compatibility/SlotReplacement.php
index 63a8316387e356aae598df6e96ae5bf701efc457..37f6cedc823161f02a799fab2c66d094cd8ebc4f 100644
--- a/typo3/sysext/core/Classes/Compatibility/SlotReplacement.php
+++ b/typo3/sysext/core/Classes/Compatibility/SlotReplacement.php
@@ -27,6 +27,8 @@ use TYPO3\CMS\Core\DataHandling\Event\AppendLinkHandlerElementsEvent;
 use TYPO3\CMS\Core\DataHandling\Event\IsTableExcludedFromReferenceIndexEvent;
 use TYPO3\CMS\Core\Imaging\Event\ModifyIconForResourcePropertiesEvent;
 use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Mail\Event\AfterMailerInitializationEvent;
+use TYPO3\CMS\Core\Mail\Mailer;
 use TYPO3\CMS\Core\Package\Event\PackagesMayHaveChangedEvent;
 use TYPO3\CMS\Core\Resource\Event\AfterFileAddedEvent;
 use TYPO3\CMS\Core\Resource\Event\AfterFileAddedToIndexEvent;
@@ -687,4 +689,11 @@ class SlotReplacement
     {
         $this->signalSlotDispatcher->dispatch('PackageManagement', 'packagesMayHaveChanged');
     }
+
+    public function postInitializeMailer(AfterMailerInitializationEvent $event): void
+    {
+        if ($event->getMailer() instanceof Mailer) {
+            $this->signalSlotDispatcher->dispatch(Mailer::class, 'postInitializeMailer', [$event->getMailer()]);
+        }
+    }
 }
diff --git a/typo3/sysext/core/Classes/Mail/Event/AfterMailerInitializationEvent.php b/typo3/sysext/core/Classes/Mail/Event/AfterMailerInitializationEvent.php
index 07de9d842b7348158cc88ebd8dc8f0adf8a19b87..3fe3b348f3b5c0cfbb09779433f7abfe78cafff2 100644
--- a/typo3/sysext/core/Classes/Mail/Event/AfterMailerInitializationEvent.php
+++ b/typo3/sysext/core/Classes/Mail/Event/AfterMailerInitializationEvent.php
@@ -16,7 +16,7 @@ namespace TYPO3\CMS\Core\Mail\Event;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Mail\Mailer;
+use Symfony\Component\Mailer\MailerInterface;
 
 /**
  * This event is fired once a new Mailer is instantiated with specific transport settings.
@@ -25,16 +25,16 @@ use TYPO3\CMS\Core\Mail\Mailer;
 final class AfterMailerInitializationEvent
 {
     /**
-     * @var Mailer
+     * @var MailerInterface
      */
     private $mailer;
 
-    public function __construct(Mailer $mailer)
+    public function __construct(MailerInterface $mailer)
     {
         $this->mailer = $mailer;
     }
 
-    public function getMailer(): Mailer
+    public function getMailer(): MailerInterface
     {
         return $this->mailer;
     }
diff --git a/typo3/sysext/core/Configuration/Services.yaml b/typo3/sysext/core/Configuration/Services.yaml
index 8ec4c77b7b5119a906fcf23873fff1f3f4fc7f7f..bd6e57342068d90f695b515e90e89d83c4b23cc5 100644
--- a/typo3/sysext/core/Configuration/Services.yaml
+++ b/typo3/sysext/core/Configuration/Services.yaml
@@ -60,12 +60,6 @@ services:
     public: true
 
   # EventListeners
-  TYPO3\CMS\Core\Compatibility\Slot\PostInitializeMailer:
-    tags:
-      - { name: event.listener,
-          identifier: 'legacy-slot',
-          event: TYPO3\CMS\Core\Mail\Event\AfterMailerInitializationEvent }
-
   TYPO3\CMS\Core\Compatibility\SlotReplacement:
     tags:
       - name: event.listener
@@ -256,6 +250,10 @@ services:
         identifier: 'legacy-slot'
         method: 'packagesMayHaveChanged'
         event: TYPO3\CMS\Core\Package\Event\PackagesMayHaveChangedEvent
+      - name: event.listener
+        identifier: 'legacy-slot'
+        method: 'postInitializeMailer'
+        event: TYPO3\CMS\Core\Mail\Event\AfterMailerInitializationEvent
 
   # FAL security checks for backend users
   TYPO3\CMS\Core\Resource\Security\StoragePermissionsAspect: