mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-11 19:16:42 +00:00
Do not use javax.mail for doCheckAdminAddress (#6166)
This commit is contained in:
1 parent
46d6af94e6
commit
72d38d2192
2 files changed
+5
-6
No files matched your search
@@ -18,8 +18,6 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.mail.internet.AddressException;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.servlet.ServletContext;
|
||||
import jenkins.util.SystemProperties;
|
||||
import jenkins.util.UrlHelper;
|
||||
@@ -210,11 +208,11 @@ public class JenkinsLocationConfiguration extends GlobalConfiguration implements
|
||||
}
|
||||
|
||||
public FormValidation doCheckAdminAddress(@QueryParameter String value) {
|
||||
try {
|
||||
new InternetAddress(value);
|
||||
// TODO if equal to Messages.Mailer_Address_Not_Configured(), suggest configuring it with FormValidation.warning?
|
||||
if (Util.fixNull(value).contains("@")) {
|
||||
return FormValidation.ok();
|
||||
} catch (AddressException e) {
|
||||
return FormValidation.error(e.getMessage());
|
||||
} else {
|
||||
return FormValidation.error(Messages.JenkinsLocationConfiguration_does_not_look_like_an_email_address());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ IdStrategy.CaseSensitive.DisplayName=Case sensitive
|
||||
IdStrategy.CaseSensitiveEmailAddress.DisplayName=Case sensitive (email address)
|
||||
|
||||
Mailer.Address.Not.Configured=address not configured yet <nobody@nowhere>
|
||||
JenkinsLocationConfiguration.does_not_look_like_an_email_address=Does not look like an email address
|
||||
Mailer.Localhost.Error=Please set a valid host name, instead of localhost
|
||||
Mailer.NotHttp.Error=The URL is invalid, please ensure you are using http:// or https:// with a valid domain.
|
||||
|
||||
|
||||
Reference in new issue
Block a user