diff --git a/.gitignore b/.gitignore index 42c021e..79d0da0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ *.iws target config.properties -bin/jetty-runner.jar \ No newline at end of file +bin/jetty-runner.jar +.idea \ No newline at end of file diff --git a/src/main/java/org/jenkinsci/account/Application.java b/src/main/java/org/jenkinsci/account/Application.java index 32ef88f..546b4bd 100644 --- a/src/main/java/org/jenkinsci/account/Application.java +++ b/src/main/java/org/jenkinsci/account/Application.java @@ -160,6 +160,10 @@ public class Application { return maybeSpammer(userid, firstName, lastName, email, ip, "Blacklist"); } + if(badUserId(userid)) { + return maybeSpammer(userid, firstName, lastName, email, ip, "badUserId"); + } + if(circuitBreaker.check()) { return maybeSpammer(userid, firstName, lastName, email, ip, "circuitBreaker"); } @@ -182,6 +186,10 @@ public class Application { return new HttpRedirect("doneMail"); } + private boolean badUserId(String userid) { + return Pattern.matches("^[sdfg]+$", userid.toLowerCase()); + } + private boolean verifyCaptcha(String uresponse, String ip) { String postParams = "secret=" + URLEncoder.encode(params.recaptchaPrivateKey()) + "&remoteip=" + URLEncoder.encode(ip) + @@ -556,6 +564,7 @@ public class Application { public static final List EMAIL_BLACKLIST = Arrays.asList( "@clrmail.com", "@guerrillamail.com", + "@mailcatch.com", "@maildx.com", "@mailinator.com", "@mailnesia.com",