diff --git a/.env.example b/.env.example index 6b060098..aaeb00d5 100644 --- a/.env.example +++ b/.env.example @@ -29,6 +29,10 @@ EMAIL_SERVERS_WITH_PRIORITY=[(10, "email.hostname.")] # these emails are ignored when computing stats # IGNORED_EMAILS = ["my_email@domain.com"] +# By default, new aliases must end with ".{random_word}". This is to avoid a person taking all "nice" aliases. +# this option doesn't make sense in self-hosted. Set this variable to disable this option. +# DISABLE_ALIAS_SUFFIX=1 + # the DKIM private key used to compute DKIM-Signature DKIM_PRIVATE_KEY_PATH=local_data/dkim.key diff --git a/README.md b/README.md index 1acb6d7e..f49ee91c 100644 --- a/README.md +++ b/README.md @@ -291,6 +291,7 @@ EMAIL_SERVERS_WITH_PRIORITY=[(10, "app.mydomain.com.")] DKIM_PRIVATE_KEY_PATH=/dkim.key DKIM_PUBLIC_KEY_PATH=/dkim.pub.key DB_URI=postgresql://myuser:mypassword@sl-db:5432/simplelogin +DISABLE_ALIAS_SUFFIX=1 ``` @@ -378,6 +379,9 @@ At this step, you should also setup the SSL for Nginx. [Certbot](https://certbot If all of the above steps are successful, open http://app.mydomain.com/ and create your first account! +By default, new accounts are not premium so don't have unlimited alias. To make your account premium, +please go to the database, table "users" and set "lifetime" column to "1" or "TRUE". + ## Contributing All work on SimpleLogin happens directly on GitHub. diff --git a/app/config.py b/app/config.py index 5053f1da..a3ebba8a 100644 --- a/app/config.py +++ b/app/config.py @@ -58,6 +58,9 @@ if os.environ.get("IGNORED_EMAILS"): else: IGNORED_EMAILS = [] +# disable the alias suffix, i.e. the ".random_word" part +DISABLE_ALIAS_SUFFIX = "DISABLE_ALIAS_SUFFIX" in os.environ + DKIM_PRIVATE_KEY_PATH = get_abs_path(os.environ["DKIM_PRIVATE_KEY_PATH"]) DKIM_PUBLIC_KEY_PATH = get_abs_path(os.environ["DKIM_PUBLIC_KEY_PATH"]) DKIM_SELECTOR = b"dkim" diff --git a/app/dashboard/templates/dashboard/custom_alias.html b/app/dashboard/templates/dashboard/custom_alias.html index e6644892..a3dd7126 100644 --- a/app/dashboard/templates/dashboard/custom_alias.html +++ b/app/dashboard/templates/dashboard/custom_alias.html @@ -35,7 +35,7 @@