redirection
This commit is contained in:
@@ -14,6 +14,14 @@ lib.mkIf hasMailDiscoveryConfig (
|
||||
mobileconfigHost = "autoconfig.${domain}";
|
||||
radicaleHost = "cal.${domain}";
|
||||
safeAccountName = email: builtins.replaceStrings [ "@" "+" ] [ "_" "-" ] email;
|
||||
emailQueryPattern = email:
|
||||
builtins.replaceStrings [
|
||||
"\\+"
|
||||
"@"
|
||||
] [
|
||||
"(?:\\+|%2B)"
|
||||
"(?:@|%40)"
|
||||
] (lib.escapeRegex email);
|
||||
|
||||
mkUuid = seed:
|
||||
let
|
||||
@@ -182,7 +190,7 @@ lib.mkIf hasMailDiscoveryConfig (
|
||||
lib.concatStrings (
|
||||
lib.mapAttrsToList (
|
||||
email: profile: ''
|
||||
if ($arg_emailaddress = "${email}") {
|
||||
if ($arg_emailaddress ~* "^${emailQueryPattern email}$") {
|
||||
return 302 /mobileconfig/${profile.safeName}.mobileconfig;
|
||||
}
|
||||
''
|
||||
|
||||
Reference in New Issue
Block a user