disposable-email-domains/verify.py

20 lines
525 B
Python
Raw Normal View History

2018-02-05 03:22:36 +01:00
#!/usr/bin/env python
"""Verify the integrity of the domain blacklist
"""
import sys
from publicsuffixlist import PublicSuffixList
def main(arguments):
psl = PublicSuffixList()
2018-02-05 03:26:23 +01:00
with open("disposable_email_blacklist.conf", "r") as deb:
2018-02-05 03:22:36 +01:00
for line in deb:
2018-02-05 03:28:28 +01:00
if psl.publicsuffix(line) == line:
2018-02-05 03:22:36 +01:00
print(f'The following line is a public suffix: {line} - please remove it from the blacklist file. See https://publicsuffix.org for details.')
if __name__ == "__main__":
main(sys.argv)