]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Fix postfix to allow + in sender mail
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 23 Apr 2020 14:51:41 +0000 (16:51 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 23 Apr 2020 14:51:41 +0000 (16:51 +0200)
modules/private/mail/postfix.nix

index 769ed5dece3a65e477ce2f3f733533bbdf78884e..52cd77d85ff4a72c76b3702409a64eb8e3364842 100644 (file)
           query = SELECT DISTINCT destination
             FROM forwardings_merge
             WHERE
-              ((regex = 1 AND '%s' REGEXP CONCAT('^',source,'$') ) OR (regex = 0 AND source = '%s'))
+              (
+                (regex = 1 AND CONCAT(SUBSTRING_INDEX('%u', '+', 1), '@%d') REGEXP CONCAT('^',source,'$') )
+              OR
+                (regex = 0 AND source = CONCAT(SUBSTRING_INDEX('%u', '+', 1), '@%d'))
+              )
               AND active = 1
-            UNION SELECT '%s' AS destination
+            UNION SELECT CONCAT(SUBSTRING_INDEX('%u', '+', 1), '@%d') AS destination
           '';
       }
       {