disposable-email-domains/verify.py

20 lines
520 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()
with open("disposable_email_blacklist", "r") as deb:
for line in deb:
if psl.publicsuffix(line) != line:
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)