]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5906 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 3 May 2023 13:17:02 +0000 (15:17 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 3 May 2023 13:17:02 +0000 (15:17 +0200)
app/Models/TeamEmails.php

index 5dc0bfbdc65533884986884bf389514d4b82780a..08f3f8c3b7f56aec7d2e04a07fee3658d13f68ed 100644 (file)
@@ -8,6 +8,7 @@ use Cubist\Backpack\Magic\Models\CubistMagicAbstractModel;
 use Cubist\Net\Util;
 use Cubist\Util\Files\Files;
 use Cubist\Util\Str;
+
 // __('!! Équipe')
 class TeamEmails extends CubistMagicAbstractModel
 {
@@ -29,6 +30,7 @@ class TeamEmails extends CubistMagicAbstractModel
         $this->addField('ip_whitelist', Table::class, __('Liste blanche IP'), ['tab' => __('Listes blanches et noires'), 'entity_singular' => __('une IP'), 'columns' => ['ip' => __('IP ou nom d\'hôte')], 'translatable' => false, 'hint' => __('IP qui sont sur la liste blanche (fail2ban, my_networks)')]);
         $this->addField('postgrey_whitelist', Code::class, __('Liste blanche postgrey'), ['translatable' => false, 'tab' => __('Listes blanches et noires'), 'language' => 'properties', 'hint' => __('Serveurs ignorés par le Grey listing')]);
         $this->addField('spam_whitelist', Table::class, __('Liste blanche SPAM'), ['tab' => __('Listes blanches et noires'), 'entity_singular' => __('un e-mail'), 'columns' => ['email' => __('E-mail')], 'translatable' => false, 'hint' => __('Les e-mails provenant de ces expéditeurs ne sont jamais considérés comme des spam (expressions régulières possibles)')]);
+        $this->addField('auth_whitelist', Table::class, __('Liste blanche DMARC/DKIM'), ['tab' => __('Listes blanches et noires'), 'entity_singular' => __('un domaine'), 'columns' => ['domain' => __('Domaine')], 'translatable' => false, 'hint' => __('Les e-mails provenant de ces domaines ne sont pas vérifiés par DMARC et DKIM')]);
         $this->addField('spam_blacklist', Table::class, __('Liste noire SPAM'), ['tab' => __('Listes blanches et noires'), 'entity_singular' => __('un e-mail'), 'columns' => ['email' => __('E-mail')], 'translatable' => false, 'hint' => __('Ces e-mails sont toujours considérés comme des spam (expressions régulières possibles)')]);
 
     }
@@ -54,6 +56,7 @@ class TeamEmails extends CubistMagicAbstractModel
             $spam_wl[] = 'whitelist_from ' . $item['email'];
         }
 
+
         $accounts = [];
         foreach ($mailboxes as $k => $m) {
             if (!isset($m['password'])) {
@@ -142,6 +145,9 @@ class TeamEmails extends CubistMagicAbstractModel
         // Postgrey whitelist
         file_put_contents(storage_path('emailconfig/whitelist_clients.local'), str_replace("\r\n", "\n", $this->postgrey_whitelist));
 
+        // OpenDMARC
+        file_put_contents(storage_path('emailconfig/opendmarc_whitelist'), json_decode($this->auth_whitelist, true));
+
         // IP Whitelist
         $my_networks = [];
         foreach ($ip as $item) {