From d113b6a53f126c289d4148f5a210c1bbf21ae118 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 5 Aug 2019 23:53:32 +0200 Subject: [PATCH] Adding some notes about diagnosis items to be implemented --- data/hooks/diagnosis/12-dnsrecords.py | 2 ++ data/hooks/diagnosis/18-mail.py | 28 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 data/hooks/diagnosis/18-mail.py diff --git a/data/hooks/diagnosis/12-dnsrecords.py b/data/hooks/diagnosis/12-dnsrecords.py index b59ffbd54..8c6565da9 100644 --- a/data/hooks/diagnosis/12-dnsrecords.py +++ b/data/hooks/diagnosis/12-dnsrecords.py @@ -31,6 +31,8 @@ class DNSRecordsDiagnoser(Diagnoser): for report in self.check_domain(domain, domain == main_domain): yield report + # FIXME : somewhere, should implement a check for reverse DNS ... + def check_domain(self, domain, is_main_domain): expected_configuration = _build_dns_conf(domain) diff --git a/data/hooks/diagnosis/18-mail.py b/data/hooks/diagnosis/18-mail.py new file mode 100644 index 000000000..5cf897e72 --- /dev/null +++ b/data/hooks/diagnosis/18-mail.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +import os + +from yunohost.diagnosis import Diagnoser + + +class MailDiagnoser(Diagnoser): + + id_ = os.path.splitext(os.path.basename(__file__))[0].split("-")[1] + cache_duration = 3600 + dependencies = ["ip"] + + def run(self): + + return # TODO / FIXME TO BE IMPLEMETED in the future ... + + # Mail blacklist using dig requests (c.f. ljf's code) + + # Outgoing port 25 (c.f. code in monitor.py, a simple 'nc -zv yunohost.org 25' IIRC) + + # SMTP reachability (c.f. check-smtp to be implemented on yunohost's remote diagnoser) + + # ideally, SPF / DMARC / DKIM validation ... (c.f. https://github.com/alexAubin/yunoScripts/blob/master/yunoDKIM.py possibly though that looks horrible) + + +def main(args, env, loggers): + return MailDiagnoser(args, env, loggers).diagnose()