Loading appinfo/info.xml +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ <command>OCA\EmailRecovery\Command\UpdateBlacklistedDomains</command> <command>OCA\EmailRecovery\Command\CreatePopularDomain</command> <command>OCA\EmailRecovery\Command\SpamAccountDetection</command> <command>OCA\EmailRecovery\Command\ResetDisposableDomainsList</command> <command>OCA\EmailRecovery\Command\RecoveryWarningNotificationCommand</command> </commands> </info> lib/Command/RecoveryWarningNotificationCommand.php +5 −5 Original line number Diff line number Diff line Loading @@ -5,19 +5,19 @@ declare(strict_types=1); namespace OCA\EmailRecovery\Command; use OCA\EmailRecovery\AppInfo\Application; use OCA\EmailRecovery\Service\RecoveryEmailService; use OCA\EmailRecovery\Service\NotificationService; use OCA\EmailRecovery\Service\RecoveryEmailService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IConfig; use OCP\IURLGenerator; use OCP\IUserManager; use OCP\Mail\IMailer; use OCP\Mail\IEMailTemplate; use OCP\Mail\IMailer; use OCP\Notification\IManager; use OCP\IURLGenerator; use OCP\AppFramework\Utility\ITimeFactory; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class RecoveryWarningNotificationCommand extends Command { private IConfig $config; Loading lib/Command/ResetDisposableDomainsList.php 0 → 100644 +34 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace OCA\EmailRecovery\Command; use OCA\EmailRecovery\AppInfo\Application; use OCA\EmailRecovery\Service\DomainService; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class ResetDisposableDomainsList extends Command { public function __construct(private DomainService $domainService) { parent::__construct(); } protected function configure() { $this ->setName(Application::APP_ID.':reset-disposable-domains-list') ->setDescription('Reset disposable domains file'); } protected function execute(InputInterface $input, OutputInterface $output): int { try { $this->domainService->resetCustomDisposableDomains(); $output->writeln('Custom disposable domains list has been reset!'); return 0; } catch (\Throwable $e) { $output->writeln('Error while resetting custom disposable domains list: ' . $e->getMessage()); return 1; } } } lib/Notification/Notifier.php +1 −1 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ namespace OCA\EmailRecovery\Notification; use OCA\EmailRecovery\AppInfo\Application; use OCA\EmailRecovery\Service\NotificationService; use OCA\EmailRecovery\Service\RecoveryEmailService; use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; use Psr\Log\LoggerInterface; use OCA\EmailRecovery\Service\RecoveryEmailService; class Notifier implements INotifier { /** @var IFactory */ Loading lib/Service/DomainService.php +6 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,12 @@ class DomainService { $this->saveDomainsToFile(self::DISPOSABLE_DOMAINS_FILE, $newDomains); } /** * Empty custom disposable domains list. */ public function resetCustomDisposableDomains() : void { $this->saveDomainsToFile(self::DISPOSABLE_DOMAINS_FILE, []); } // ------------------------------- // Private Helper Methods // ------------------------------- Loading Loading
appinfo/info.xml +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ <command>OCA\EmailRecovery\Command\UpdateBlacklistedDomains</command> <command>OCA\EmailRecovery\Command\CreatePopularDomain</command> <command>OCA\EmailRecovery\Command\SpamAccountDetection</command> <command>OCA\EmailRecovery\Command\ResetDisposableDomainsList</command> <command>OCA\EmailRecovery\Command\RecoveryWarningNotificationCommand</command> </commands> </info>
lib/Command/RecoveryWarningNotificationCommand.php +5 −5 Original line number Diff line number Diff line Loading @@ -5,19 +5,19 @@ declare(strict_types=1); namespace OCA\EmailRecovery\Command; use OCA\EmailRecovery\AppInfo\Application; use OCA\EmailRecovery\Service\RecoveryEmailService; use OCA\EmailRecovery\Service\NotificationService; use OCA\EmailRecovery\Service\RecoveryEmailService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IConfig; use OCP\IURLGenerator; use OCP\IUserManager; use OCP\Mail\IMailer; use OCP\Mail\IEMailTemplate; use OCP\Mail\IMailer; use OCP\Notification\IManager; use OCP\IURLGenerator; use OCP\AppFramework\Utility\ITimeFactory; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class RecoveryWarningNotificationCommand extends Command { private IConfig $config; Loading
lib/Command/ResetDisposableDomainsList.php 0 → 100644 +34 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace OCA\EmailRecovery\Command; use OCA\EmailRecovery\AppInfo\Application; use OCA\EmailRecovery\Service\DomainService; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class ResetDisposableDomainsList extends Command { public function __construct(private DomainService $domainService) { parent::__construct(); } protected function configure() { $this ->setName(Application::APP_ID.':reset-disposable-domains-list') ->setDescription('Reset disposable domains file'); } protected function execute(InputInterface $input, OutputInterface $output): int { try { $this->domainService->resetCustomDisposableDomains(); $output->writeln('Custom disposable domains list has been reset!'); return 0; } catch (\Throwable $e) { $output->writeln('Error while resetting custom disposable domains list: ' . $e->getMessage()); return 1; } } }
lib/Notification/Notifier.php +1 −1 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ namespace OCA\EmailRecovery\Notification; use OCA\EmailRecovery\AppInfo\Application; use OCA\EmailRecovery\Service\NotificationService; use OCA\EmailRecovery\Service\RecoveryEmailService; use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; use Psr\Log\LoggerInterface; use OCA\EmailRecovery\Service\RecoveryEmailService; class Notifier implements INotifier { /** @var IFactory */ Loading
lib/Service/DomainService.php +6 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,12 @@ class DomainService { $this->saveDomainsToFile(self::DISPOSABLE_DOMAINS_FILE, $newDomains); } /** * Empty custom disposable domains list. */ public function resetCustomDisposableDomains() : void { $this->saveDomainsToFile(self::DISPOSABLE_DOMAINS_FILE, []); } // ------------------------------- // Private Helper Methods // ------------------------------- Loading