This repository has been archived on 2022-04-27. You can view files and clone it, but cannot push or open issues or pull requests.
peret/login.py

20 lines
696 B
Python

import csv
from email.utils import parseaddr
from test import MailTest
def check(cnt, file):
data, uname = cnt
username, address = parseaddr(uname)
with open(file, encoding='utf-8') as fd:
people = csv.reader(fd)
for p in people:
if address.lower() == p[4].lower() or uname.lower().find(p[2].lower()) >= 0 or username.lower().replace(" ", "").find(p[0].lower().replace(" ", "")) >= 0 and username.lower().find(p[1].lower()) >= 0:
yield MailTest("Recognized as %s: %s %s." % (p[2], p[1], p[0]))
yield data, p[2]
return
yield MailTest("The username of your key is not explicit, I can't find you.", 1)