Merge branch 'master' of ssh://github.com/jsha/starttls-everywhere

Conflicts:
	MTAConfigGenerator.py
This commit is contained in:
Peter Eckersley
2014-06-16 02:47:15 -07:00
6 changed files with 19 additions and 11 deletions
+2
View File
@@ -0,0 +1,2 @@
.*
*.orig
-1
View File
@@ -36,7 +36,6 @@ class Config:
f = open(cfg_file_name)
self.cfg = json.loads(f.read())
for atr, val in self.cfg.items():
#print atr,val
# Verify each attribute of the structure
if atr.startswith("comment"):
continue
+3 -5
View File
@@ -3,7 +3,7 @@
import string
import os, os.path
POSTFIX_DIR = "/etc/postfix"
POSTFIX_DIR = "postfix-copy"
DEFAULT_POLICY_FILE = os.path.join(POSTFIX_DIR, "starttls_everywhere_policy")
POLICY_CF_ENTRY="texthash:" + DEFAULT_POLICY_FILE
@@ -19,8 +19,6 @@ def parse_line(line_data):
return None
return (num, left.strip(), right.strip())
#def get_cf_values(lines, var):
class MTAConfigGenerator:
def __init__(self, policy_config):
self.policy_config = policy_config
@@ -39,8 +37,8 @@ class PostfixConfigGenerator(MTAConfigGenerator):
def ensure_cf_var(self, var, ideal, also_acceptable):
"""
Ensure that existing postfix config @var is in the list of @acceptable
values; if not, set it to the ideal value. """
values; if not, set it to the ideal value.
"""
acceptable = [ideal] + also_acceptable
l = [(num,line) for num,line in enumerate(self.cf) if line.startswith(var)]
+10 -1
View File
@@ -1,4 +1,13 @@
#!/usr/bin/python
"""
Process Google's TLS delivery data from
https://www.google.com/transparencyreport/saferemail/data/?hl=en
to look for outbound domains that can negotiate an encrypted
connection >99% of the time.
Usage:
./ProcessGoogleSTARTTLSDomains.py google-starttls-domains.csv
"""
import csv
import codecs
import sys
@@ -14,5 +23,5 @@ for (address_suffix, hostname_suffix, direction, region, fraction_encrypted) in
pass
for address_suffix, fraction_encrypted in d.iteritems():
if min(fraction_encrypted) >= 0.50:
if min(fraction_encrypted) >= 0.99:
print min(fraction_encrypted), address_suffix
+1 -1
View File
@@ -3,7 +3,7 @@
"timestamp": 1401093333,
"author": "Electronic Frontier Foundation https://eff.org",
"expires": 1404677353, "comment 2:": "epoch seconds",
"security-policies": {
"tls-policies": {
"*.valid-example-recipient.com": {
"min-tls-version": "TLSv1.1"
}