disposable-email-domains/verify.py

20 lines
525 B
Python
Raw Normal View History

2018-02-05 10:22:36 +08: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 10:26:23 +08:00
with open("disposable_email_blacklist.conf", "r") as deb:
2018-02-05 10:22:36 +08:00
for line in deb:
2018-02-05 10:28:28 +08:00
if psl.publicsuffix(line) == line:
2018-02-05 10:22:36 +08: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)