summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2024-11-17 13:43:19 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2024-11-17 13:43:19 +0100
commit3e052f72c160adc5422bb09bc25c5dd38ee59170 (patch)
tree11e239dab6f859fb6e2dbb4cb284b8d8019293f5
parentc7e91245005b3209fd32ab1064d8bcf3ddaed801 (diff)
use which from shutil for proper path lookup
-rw-r--r--.gitignore1
-rw-r--r--src/jwebmail/__init__.py8
2 files changed, 5 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 0247f3c..7dcb5dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ jwebmail_pb2.py
jwebmail_pb2.pyi
inventory.ini
script/extract
+script/extract-release
diff --git a/src/jwebmail/__init__.py b/src/jwebmail/__init__.py
index ff6d17c..fe32430 100644
--- a/src/jwebmail/__init__.py
+++ b/src/jwebmail/__init__.py
@@ -1,7 +1,7 @@
-import os.path as os_path
import sys
from datetime import datetime
from os import environ
+from shutil import which
from babel import parse_locale
from flask import Flask, abort, g, redirect, url_for
@@ -36,7 +36,7 @@ else:
toml_read_file = dict(load=toml_load, text=True)
-__version__ = "2.6.0.dev1"
+__version__ = "2.6.0.dev2"
csrf = CSRFProtect()
@@ -46,9 +46,9 @@ def validate_config(app):
assert "@" in conf["JWEBMAIL"]["ADMIN_MAIL"]
- assert os_path.isfile(conf["JWEBMAIL"]["READ_MAILS"]["BACKEND"])
+ assert which(conf["JWEBMAIL"]["READ_MAILS"]["BACKEND"])
- assert os_path.isfile(
+ assert which(
conf["JWEBMAIL"]["READ_MAILS"].setdefault("AUTHENTICATOR", "qmail-authuser")
)