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

20 lines
520 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", "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)