From 64641d01f53556b58eb3b4c1dd3c2a5dfa389bf9 Mon Sep 17 00:00:00 2001 From: zPlus Date: Tue, 21 Mar 2023 22:19:10 +0100 Subject: [PATCH] Add environment variables in .forward file. Allows specifying of emails settings as envvars from .forward file. --- documentation/administrators | 2 +- emails.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/administrators b/documentation/administrators index 083f8e3..7f53a04 100644 --- a/documentation/administrators +++ b/documentation/administrators @@ -165,7 +165,7 @@ system user "git" 3. Create the file /home/git/.forward with the content: - |/home/git/clif/emails.py + "| SERVER_DOMAIN= REPOSITORIES_PATH= /home/git/clif/emails.py" This is a sendmail file (also used by postfix) for deciding how incoming messages shall be delivered to the the system user. For our purposes, we instruct postfix diff --git a/emails.py b/emails.py index 334b6f3..fea03fb 100755 --- a/emails.py +++ b/emails.py @@ -22,11 +22,11 @@ import sys # The "domain" part in address@domain for the mailing lists. # All emails addressed to another domain will be ignored. -SERVER_DOMAIN = None +SERVER_DOMAIN = os.environ.get('SERVER_DOMAIN') # The folder containing the git repositories. # If using Gitolite, this is the Gitolite's "repositories" folder -REPOSITORIES_PATH = None +REPOSITORIES_PATH = os.environ.get('REPOSITORIES_PATH') # Level | Numeric value # ---------|--------------