From 6fa46042dc29bb6173607ce1a22610da371f4579 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Thu, 16 Apr 2020 09:42:34 +0200 Subject: [PATCH] Add DISPOSABLE_FILE_PATH param --- app/config.py | 11 +++++++++++ local_data/local_disposable_domains.txt | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 local_data/local_disposable_domains.txt diff --git a/app/config.py b/app/config.py index ef505d2b..7d8d8f88 100644 --- a/app/config.py +++ b/app/config.py @@ -232,3 +232,14 @@ LANDING_PAGE_URL = os.environ.get("LANDING_PAGE_URL") or "https://simplelogin.io # Loading PGP keys when mail_handler runs. To be used locally when init_app is not called. LOAD_PGP_EMAIL_HANDLER = "LOAD_PGP_EMAIL_HANDLER" in os.environ + +DISPOSABLE_FILE_PATH = get_abs_path( + os.environ.get("DISPOSABLE_FILE_PATH", "local_data/local_disposable_domains.txt") +) + +with open(get_abs_path(DISPOSABLE_FILE_PATH), "r") as f: + DISPOSABLE_EMAIL_DOMAINS = f.readlines() + DISPOSABLE_EMAIL_DOMAINS = [d.strip().lower() for d in DISPOSABLE_EMAIL_DOMAINS] + DISPOSABLE_EMAIL_DOMAINS = [ + d for d in DISPOSABLE_EMAIL_DOMAINS if not d.startswith("#") + ] diff --git a/local_data/local_disposable_domains.txt b/local_data/local_disposable_domains.txt new file mode 100644 index 00000000..7eeb3819 --- /dev/null +++ b/local_data/local_disposable_domains.txt @@ -0,0 +1,3 @@ +10minutesmail.fr +temp-mail.com +# protonmail.com \ No newline at end of file