deny applications from list of domains by marking the email address
invalid. prevents trivial attack.
(String.explode s)
fun validEmail s =
- (case String.fields (fn ch => ch = #"@") s of
- [user, host] => validEmailUser user andalso validDomain host
- | _ => false)
+ case String.fields (fn ch => ch = #"@") s of
+ [user, host] => validEmailUser user andalso validDomain host andalso not (List.exists (fn x => x = host) Config.joinBannedEmailDomains)
+ | _ => false
fun userExists name =
case C.oneOrNoRows (getDb ()) ($`SELECT id FROM WebUser WHERE name = ^(C.stringToSql name)`) of
val statsRoot : string
val staticFilesRoot : string
+val joinBannedEmailDomains : string list
+(* domains that may not be used in member applications, really
+rudimentary spam filtering for some persistent spammers that use the
+same two domains. *)
+
end
val statsRoot = "/afs/hcoop.net/user/h/hc/hcoop/portal-tools/etc/stats/"
val staticFilesRoot = "/afs/hcoop.net/user/h/hc/hcoop/portal-tools/etc/static/"
+val joinBannedEmailDomains = [ "163.com", "yeah.net"]
+
end