diff --git a/internal/common/eventmanager.go b/internal/common/eventmanager.go index aaa9cf5d..ce15e68f 100644 --- a/internal/common/eventmanager.go +++ b/internal/common/eventmanager.go @@ -1519,7 +1519,7 @@ func executeCommandRuleAction(c dataprovider.EventActionCommandConfig, params *E cmd := exec.CommandContext(ctx, c.Cmd, args...) cmd.Env = []string{} for _, keyVal := range c.EnvVars { - if keyVal.Value == "$" { + if keyVal.Value == "$" && !strings.HasPrefix(strings.ToUpper(keyVal.Key), "SFTPGO_") { val := os.Getenv(keyVal.Key) if val == "" { eventManagerLog(logger.LevelDebug, "empty value for environment variable %q", keyVal.Key) diff --git a/static/locales/en/translation.json b/static/locales/en/translation.json index cae6ade6..f4984525 100644 --- a/static/locales/en/translation.json +++ b/static/locales/en/translation.json @@ -977,7 +977,7 @@ "command_help": "Absolute path of the command to execute", "command_args": "Arguments", "command_args_help": "Comma separated command arguments. Placeholders are supported", - "command_env_vars_help": "Placeholders are supported in values. Setting the name to \"$\" without quotes means retrieving the value from the environment", + "command_env_vars_help": "Placeholders are supported in values. Setting the value to \"$\" without quotes means retrieving the key from the environment excluding keys starting with SFTPGO_", "email_recipients": "To", "email_recipients_help": "Comma separated recipients. Placeholders are supported", "email_bcc": "Bcc", diff --git a/static/locales/it/translation.json b/static/locales/it/translation.json index 246ed893..6515af38 100644 --- a/static/locales/it/translation.json +++ b/static/locales/it/translation.json @@ -977,7 +977,7 @@ "command_help": "Percorso assoluto del comando da eseguire", "command_args": "Argomenti", "command_args_help": "Argomenti del comando separati da virgole. I segnaposto sono supportati", - "command_env_vars_help": "I segnaposto sono supportati nei valori. Impostare il nome su \"$\" senza virgolette significa recuperare il valore dall'ambiente", + "command_env_vars_help": "I segnaposto sono supportati nei valori. Impostare il valore su \"$\" senza virgolette significa recuperare il nome dall'ambiente ad esclusione dei nomi che iniziano con SFTPGO_", "email_recipients": "A", "email_recipients_help": "Destinatari separati da virgole. I segnaposto sono supportati", "email_bcc": "Ccn",