From d8c20bc395b22fb5552afc8b69e8c60493228d2d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 23 Apr 2020 16:51:41 +0200 Subject: [PATCH] Fix postfix to allow + in sender mail --- modules/private/mail/postfix.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 ''; } { -- 2.41.0