Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to print MTA-STS missing DNS policy error reason #1884

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion management/status_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,16 @@ def check_mail_domain(domain, env, output):
else:
output.print_error("MTA-STS policy is present but has unexpected settings. [{}]".format(policy[1]))
else:
output.print_error("MTA-STS policy is missing: {}".format(valid))
certmessage = ''
cert = get_ssl_certificates(env).get(domain)
if not cert:
certmessage = "No TLS certificate provisioned for this domain"
else:
cert_status = check_certificate(domain, cert['certificate'], cert['private-key'])
if cert_status[0] != 'OK':
certmessage = "TLS certificate is not valid"
Comment on lines +665 to +670
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm suggesting having no message (no call to output.print_error) in these two conditions.

Copy link
Author

@ValdikSS ValdikSS Jan 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to remove these text messages completely or print them not as an error? If the second, how it should be printed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove completely. Sorry for the ambiguity.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to edit this merge request as is suitable for the codebase. I'm no longer use MIAB actively and can't test my edit right now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me 👍


output.print_error("MTA-STS policy is missing: {}".format(certmessage if certmessage else valid))

else:
output.print_error("""This domain's DNS MX record is incorrect. It is currently set to '%s' but should be '%s'. Mail will not
Expand Down