mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 19:31:51 +02:00
Confirmed Postfix log parsing is working again.
This commit is contained in:
@@ -278,7 +278,7 @@ class Config(BaseConfig):
|
|||||||
labels = mx_hostname.split(".")
|
labels = mx_hostname.split(".")
|
||||||
for n in range(1, len(labels)):
|
for n in range(1, len(labels)):
|
||||||
parent = "." + ".".join(labels[n:])
|
parent = "." + ".".join(labels[n:])
|
||||||
if parent in mx_to_domains_map:
|
if parent in mx_to_domain_map:
|
||||||
return mx_to_domain_map[parent]
|
return mx_to_domain_map[parent]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
import Config as config
|
import Config
|
||||||
|
|
||||||
# TODO: There's more to be learned from postfix logs! Here's one sample
|
# TODO: There's more to be learned from postfix logs! Here's one sample
|
||||||
# observed during failures from the sender vagrant vm:
|
# observed during failures from the sender vagrant vm:
|
||||||
@@ -47,7 +47,8 @@ def get_counts(input, config):
|
|||||||
seen_trusted = True
|
seen_trusted = True
|
||||||
address_domains = config.get_address_domains(mx_hostname, mx_to_domain_mapping)
|
address_domains = config.get_address_domains(mx_hostname, mx_to_domain_mapping)
|
||||||
if address_domains:
|
if address_domains:
|
||||||
d = ', '.join(address_domains)
|
domains_str = [ a.domain for a in address_domains ]
|
||||||
|
d = ', '.join(domains_str)
|
||||||
counts[d][validation] += 1
|
counts[d][validation] += 1
|
||||||
counts[d]["all"] += 1
|
counts[d]["all"] += 1
|
||||||
elif deferred:
|
elif deferred:
|
||||||
@@ -70,8 +71,8 @@ if __name__ == "__main__":
|
|||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
print "Usage: %s starttls-everywhere.json" % sys.argv[0]
|
print "Usage: %s starttls-everywhere.json" % sys.argv[0]
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
c = config.Config()
|
config = Config.Config()
|
||||||
c.load_from_json_file(sys.argv[1])
|
config.load_from_json_file(sys.argv[1])
|
||||||
(counts, tls_deferred) = get_counts(sys.stdin, config)
|
(counts, tls_deferred) = get_counts(sys.stdin, config)
|
||||||
print_summary(counts)
|
print_summary(counts)
|
||||||
print tls_deferred
|
print tls_deferred
|
||||||
|
|||||||
Reference in New Issue
Block a user