From: Ismaƫl Bouya Date: Thu, 23 Apr 2020 14:51:41 +0000 (+0200) Subject: Fix postfix to allow + in sender mail X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=commitdiff_plain;h=d8c20bc395b22fb5552afc8b69e8c60493228d2d Fix postfix to allow + in sender mail --- diff --git a/modules/private/mail/postfix.nix b/modules/private/mail/postfix.nix index 769ed5d..52cd77d 100644 --- a/modules/private/mail/postfix.nix +++ b/modules/private/mail/postfix.nix @@ -75,9 +75,13 @@ 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 ''; } {