diff --git a/app/dashboard/templates/dashboard/domain_detail/dns.html b/app/dashboard/templates/dashboard/domain_detail/dns.html index a6a78dc5..6207a708 100644 --- a/app/dashboard/templates/dashboard/domain_detail/dns.html +++ b/app/dashboard/templates/dashboard/domain_detail/dns.html @@ -56,6 +56,9 @@
Your DNS is not correctly set. The MX record we obtain is:
+ {% if not mx_errors %} + (Empty) + {% endif %} {% for r in mx_errors %} {{ r }}
{% endfor %} @@ -112,6 +115,10 @@
Your DNS is not correctly set. The TXT record we obtain is:
+ {% if not spf_errors %} + (Empty) + {% endif %} + {% for r in spf_errors %} {{ r }}
{% endfor %} diff --git a/app/dashboard/templates/dashboard/index.html b/app/dashboard/templates/dashboard/index.html index f1e972e9..b270dc66 100644 --- a/app/dashboard/templates/dashboard/index.html +++ b/app/dashboard/templates/dashboard/index.html @@ -152,16 +152,15 @@ {% if alias_info.show_intro_test_send_email %} data-intro="Not only alias can receive emails, it can send emails too!

You can add a new contact to for your alias here.

- To send an email to your contact, SimpleLogin will create a special email address:
- sending an email to this email address will forward your email to your contact" + To send an email to your contact, SimpleLogin will create a special email address.

+ Sending an email to this email address will forward the email to your contact" data-step="4" {% endif %} class="btn btn-sm btn-outline-primary" data-toggle="tooltip" - title="Send email from alias" + title="Not only an alias can receive emails, it can send emails too" > Send Email     - Beta {% endif %}
diff --git a/app/dashboard/views/domain_detail.py b/app/dashboard/views/domain_detail.py index c0557c26..88bcf98b 100644 --- a/app/dashboard/views/domain_detail.py +++ b/app/dashboard/views/domain_detail.py @@ -34,6 +34,7 @@ def domain_detail_dns(custom_domain_id): mx_domains = get_mx_domains(custom_domain.domain) if sorted(mx_domains) != sorted(EMAIL_SERVERS_WITH_PRIORITY): + flash("The MX record is not correctly set", "warning") mx_ok = False # build mx_errors to show to user mx_errors = [ @@ -63,7 +64,10 @@ def domain_detail_dns(custom_domain_id): ) ) else: - flash(f"{EMAIL_DOMAIN} is not included in your SPF record.", "warning") + flash( + f"SPF: {EMAIL_DOMAIN} is not included in your SPF record.", + "warning", + ) spf_ok = False spf_errors = get_txt_record(custom_domain.domain) @@ -81,6 +85,7 @@ def domain_detail_dns(custom_domain_id): ) ) else: + flash("DKIM: the TXT record is not correctly set", "warning") dkim_ok = False dkim_errors = get_txt_record(f"dkim._domainkey.{custom_domain.domain}") diff --git a/app/dns_utils.py b/app/dns_utils.py index 0110b343..cb0f1799 100644 --- a/app/dns_utils.py +++ b/app/dns_utils.py @@ -7,7 +7,7 @@ def get_mx_domains(hostname) -> [(int, str)]: """ try: answers = dns.resolver.query(hostname, "MX") - except dns.resolver.NoAnswer: + except Exception: return [] ret = [] @@ -28,7 +28,7 @@ def get_spf_domain(hostname) -> [str]: """return all domains listed in *include:*""" try: answers = dns.resolver.query(hostname, "TXT") - except dns.resolver.NoAnswer: + except Exception: return [] ret = [] @@ -49,7 +49,7 @@ def get_spf_domain(hostname) -> [str]: def get_txt_record(hostname) -> [str]: try: answers = dns.resolver.query(hostname, "TXT") - except dns.resolver.NoAnswer: + except Exception: return [] ret = [] @@ -67,7 +67,7 @@ def get_dkim_record(hostname) -> str: """query the dkim._domainkey.{hostname} record and returns its value""" try: answers = dns.resolver.query(f"dkim._domainkey.{hostname}", "TXT") - except dns.resolver.NoAnswer: + except Exception: return "" ret = [] diff --git a/server.py b/server.py index 79133514..a9f29264 100644 --- a/server.py +++ b/server.py @@ -9,6 +9,9 @@ from flask_admin import Admin from flask_cors import cross_origin from flask_login import current_user from sentry_sdk.integrations.flask import FlaskIntegration +from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration +from sentry_sdk.integrations.aiohttp import AioHttpIntegration + from app import paddle_utils from app.admin_model import SLModelView, SLAdminIndexView @@ -48,7 +51,14 @@ from app.oauth.base import oauth_bp if SENTRY_DSN: LOG.d("enable sentry") - sentry_sdk.init(dsn=SENTRY_DSN, integrations=[FlaskIntegration()]) + sentry_sdk.init( + dsn=SENTRY_DSN, + integrations=[ + FlaskIntegration(), + SqlalchemyIntegration(), + AioHttpIntegration(), + ], + ) # the app is served behin nginx which uses http and not https os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1" @@ -185,7 +195,7 @@ def register_blueprints(app: Flask): def set_index_page(app): - @app.route("/") + @app.route("/", methods=["GET", "POST"]) def index(): if current_user.is_authenticated: return redirect(url_for("dashboard.index"))