leereilly / swot

:school: Identify email addresses or domains names that belong to colleges or universities. Help automate the process of approving or rejecting academic discounts.
MIT License
1.12k stars 21.23k forks source link

Domains with hyphen in directory name returning invalid #1545

Open jackocnr opened 6 years ago

jackocnr commented 6 years ago

e.g. test@etud.u-pem.fr

This domain was added over a year ago, and so this email address should return valid. https://github.com/leereilly/swot/commit/6799cd068fe40271de4f703b43c90b91f5bbf68b

I've had the same issue adding other similar domains in my private fork e.g. I recently added @etud.sorbonne-nouvelle.fr and then noticed emails with that domain were returning invalid.

My guess is that the issue is with directory names containing a hyphen, but I'm not sure as I had quick look and couldn't find any others. It's not an issue when the txt filename contains a hyphen.

Thanks.

andydust commented 6 years ago

The hyphen is a red herring. The reason the example above isn't working is because it appears to be a design decision not to support subdomains (as documented in CONTRIBUTING ). https://github.com/leereilly/swot/commit/6799cd068fe40271de4f703b43c90b91f5bbf68b should have simply added /fr/u-pem.txt and ignored the etud subdomain. Incorrectly added subdomains should be reviewed and addressed in a PR.

Worth noting that the downside of this decision is that Swot cannot support .school_name queries at the granular level of individual schools/faculties within a larger academic institution.

jackocnr commented 6 years ago

Another example is @master.hes-so.ch