disposable-email-domains/verify.py
2018-02-04 21:28:28 -05:00

20 lines
525 B
Python

#!/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.conf", "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)