From ea092ec0b3f3a163a9c73b3889387f60ece04337 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 11 May 2026 14:26:47 +0900 Subject: [PATCH] temmie/userweb: pass userdir user to sendmail through custom envvar --- hosts/temmie/services/userweb/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hosts/temmie/services/userweb/default.nix b/hosts/temmie/services/userweb/default.nix index f9b9fa6..57f5712 100644 --- a/hosts/temmie/services/userweb/default.nix +++ b/hosts/temmie/services/userweb/default.nix @@ -70,9 +70,9 @@ let text = '' args=("$@") - if [[ "''${PWD:-}" =~ ^/home/pvv/[^/]+/([^/]+) ]] && [[ "''${BASH_REMATCH[1]}" != "pvv" ]]; then + if [[ -z "$USERDIR_USER" ]] && [[ "$USERDIR_USER" != "pvv" ]]; then # Prepend -fusername to the argument list, so bounces go to the user - args=("-f''${BASH_REMATCH[1]}" "''${args[@]}") + args=("-f$USERDIR_USER" "''${args[@]}") fi exec '${lib.getExe pkgs.system-sendmail}' "''${args[@]}" @@ -209,6 +209,7 @@ in UserDir disabled root AddHandler cgi-script .cgi DirectoryIndex index.html index.html.var index.php index.php3 index.cgi index.phtml index.shtml meg.html + SetEnvIf Request_URI "^/~([^/]+)" USERDIR_USER=$1 Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI IncludesNoExec