Jump to content
Froxlor Forum
  • 0

CatchAll Problem


mrairstone

Question

Guten Morgen,

mir ist in Froxlor ein kleiner Fehler in Bezug auf CatchAll Email aufgefallen.

Zum System:

  • Debian 10, 64-Bit
  • Froxlor 0.10.11
  • Postfix, Dovecot, Spamc

Zum Problem:

Beim Anlegen einer neuen E-Mailadresse kann man je Domain nur eine CatchAll-Adresse definieren. Wenn man jedoch eine bestehende E-Mailadresse bearbeitet, kann man dort ganz einfach auf CatchAll umschalten.
Dadurch kann es passieren, dass mehrere Emailadressen unterhalb einer Domain als CatchAll definiert sind. Das ist mir erst aufgefallen, als ich E-Mails in meinem Postfach hatte, welche nicht für meine E-Mailadresse bestimmt waren.

Da auf dem Account in Froxlor mehrer Nutzer zugreifen (Feuerwehr) und E-Mailadressen hinzufügen, ändern und auch löschen - habe ich erst sehr spät gesehen das mehrere CatchAll vorhanden waren.

Wenn man eine Mail an eine E-Mailadresse sendet, welche als CatchAll definiert wurde, wird die Mail auch an alle anderen E-Mailadressen weitergeleitet, die unterhalb der Domain als CatchAll definiert sind.(Jedenfalls bei postfix)

Temporäre Lösung:

Damit eingehende Mails an eine vorhandene E-Mailadresse, welche als CatchAll definiert ist, auch nur im Postfach dieser E-Mailadresse landen, habe ich die SQL-Anweisung in der "mysql-virtual_alias_maps.cf" wie folgt abgeändert:

query = SELECT destination FROM mail_virtual AS v, panel_customers AS c WHERE c.customerid = v.customerid AND c.deactivated = 0 AND (v.email = '%s' OR v.email_full = '%s') AND trim(v.destination) <> ''

Ich habe das eben auch noch einmal in der Demoversion ausprobiert, Screenshot im Anhang.

 

Gruß

froxlor_catchall.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

Hey, danke fürs checken. Probierst du mal folgenden Patch?

diff --git a/lib/Froxlor/Api/Commands/Emails.php b/lib/Froxlor/Api/Commands/Emails.php
index 80270e55..af1cd0a2 100644
--- a/lib/Froxlor/Api/Commands/Emails.php
+++ b/lib/Froxlor/Api/Commands/Emails.php
@@ -106,10 +106,12 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
                        );
                        $email_check = Database::pexecute_first($stmt, $params, true, true);
 
-                       if (strtolower($email_check['email_full']) == strtolower($email_full)) {
-                               \Froxlor\UI\Response::standard_error('emailexistalready', $email_full, true);
-                       } elseif ($email_check['email'] == $email) {
-                               \Froxlor\UI\Response::standard_error('youhavealreadyacatchallforthisdomain', '', true);
+                       if ($email_check) {
+                               if (strtolower($email_check['email_full']) == strtolower($email_full)) {
+                                       \Froxlor\UI\Response::standard_error('emailexistalready', $email_full, true);
+                               } elseif ($email_check['email'] == $email) {
+                                       \Froxlor\UI\Response::standard_error('youhavealreadyacatchallforthisdomain', '', true);
+                               }
                        }
 
                        $stmt = Database::prepare("
@@ -233,6 +235,19 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
                        $iscatchall = '1';
                        $email_parts = explode('@', $result['email_full']);
                        $email = '@' . $email_parts[1];
+                       // catchall check
+                       $stmt = Database::prepare("
+                               SELECT `email_full` FROM `" . TABLE_MAIL_VIRTUAL . "`
+                               WHERE `email` = :email AND `customerid` = :cid AND `iscatchall` = '1'
+                       ");
+                       $params = array(
+                               "email" => $email,
+                               "cid" => $customer['customerid']
+                       );
+                       $email_check = Database::pexecute_first($stmt, $params, true, true);
+                       if ($email_check) {
+                               \Froxlor\UI\Response::standard_error('youhavealreadyacatchallforthisdomain', '', true);
+                       }
                } else {
                        $iscatchall = '0';
                        $email = $result['email_full'];

 

Link to comment
Share on other sites

  • 0

Hey, läuft.

Der Patch ist drin und nun ist es auch beim Bearbeiten einer E-Mailadresse nicht mehr möglich mehr als eine CatchAll je Domain zu definieren.
Ich habe dann zum Test einmal die eigentliche CatchAll deaktiviert und danach wieder aktiviert. Alles top!

Vielen Dank für die schnelle Reaktion.

 

Gruß

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...