diff --git a/src/main/java/org/gcube/portlets/user/MailForm.java b/src/main/java/org/gcube/portlets/user/MailForm.java index b781508..9d80b57 100644 --- a/src/main/java/org/gcube/portlets/user/MailForm.java +++ b/src/main/java/org/gcube/portlets/user/MailForm.java @@ -41,11 +41,14 @@ public class MailForm extends MVCPortlet { HttpServletRequest request = PortalUtil.getHttpServletRequest(actionRequest); String hostname = PortalUtil.getHost(actionRequest); System.out.println("hostname to split:" + hostname); - String[] splits = hostname.split("www."); String emailAddress = "info@d4science.org"; - if (splits.length > 1) - emailAddress = "info@"+ hostname.split("www.")[1]; - + if (hostname.equalsIgnoreCase("gcube-system.org")) { + emailAddress = "info@gcube-system.org"; + } else { + String[] splits = hostname.split("www."); + if (splits.length > 1) + emailAddress = "info@"+ hostname.split("www.")[1]; + } try { /** * This is the actual code which validate captcha data entered by user. @@ -59,7 +62,7 @@ public class MailForm extends MVCPortlet { String bodyTextHTML = "

From: " + name + "

"; bodyTextHTML += "

Email: " + email + "

"; bodyTextHTML += "

Message:

" + message + "

"; - + String validEmail = "info@d4science.org"; //fallback if (isValidEmailAddress(emailAddress)) {