Package hudson.tasks
Class Mailer.DescriptorImpl
- Enclosing class:
- Mailer
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
configure
(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) jakarta.mail.Session
Creates a JavaMail session.doAddressCheck
(String value) doCheckAuthentication
(boolean authentication, boolean useSsl, boolean useTls) doCheckDefaultSuffix
(String value) doCheckSmtpHost
(String value) doSendTestMail
(String smtpHost, String adminAddress, boolean authentication, String username, Secret password, boolean useSsl, boolean useTls, String smtpPort, String charset, String sendTestMailTo) Send an email to the admin addressDeprecated.Deprecated.as of 1.21 Useauthentication
Deprecated.as of 1.21 Useauthentication
Deprecated.as of 1.23, usegetSmtpHost()
getUrl()
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
insteadboolean
boolean
boolean
isApplicable
(Class<? extends AbstractProject> jobType) newInstance
(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) void
setAdminAddress
(String adminAddress) Deprecated.as of 1.4 UseJenkinsLocationConfiguration
insteadvoid
setAuthentication
(SMTPAuthentication authentication) void
setCharset
(String charset) void
setDefaultSuffix
(String defaultSuffix) void
setHudsonUrl
(String hudsonUrl) Deprecated.as of 1.4 UseJenkinsLocationConfiguration
insteadvoid
setReplyToAddress
(String address) void
setSmtpAuth
(String userName, String password) Deprecated.as of 1.21 Useauthentication
void
setSmtpHost
(String smtpHost) void
setSmtpPort
(String smtpPort) void
setUseSsl
(boolean useSsl) void
setUseTls
(boolean useTls) Methods inherited from class hudson.tasks.BuildStepDescriptor
filter
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
DescriptorImpl
public DescriptorImpl()
-
-
Method Details
-
getRequiredGlobalConfigPagePermission
- Overrides:
getRequiredGlobalConfigPagePermission
in classDescriptor<Publisher>
-
getDisplayName
- Overrides:
getDisplayName
in classDescriptor<Publisher>
-
getDefaultSuffix
-
getReplyToAddress
-
setReplyToAddress
-
createSession
public jakarta.mail.Session createSession()Creates a JavaMail session.- Returns:
- mail session based on the underlying session parameters.
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) throws Descriptor.FormException - Overrides:
configure
in classDescriptor<Publisher>
- Throws:
Descriptor.FormException
-
getSmtpHost
-
getSmtpServer
Deprecated.as of 1.23, usegetSmtpHost()
-
getAdminAddress
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
instead- Returns:
- administrator mail address
-
getUrl
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
instead- Returns:
- Jenkins base URL
-
getSmtpAuthUserName
Deprecated.as of 1.21 Useauthentication
-
getSmtpAuthPassword
Deprecated.as of 1.21 Useauthentication
-
getSmtpAuthPasswordSecret
-
getUseSsl
public boolean getUseSsl() -
getUseTls
public boolean getUseTls() -
getSmtpPort
-
getCharset
-
setDefaultSuffix
-
setHudsonUrl
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
instead- Parameters:
hudsonUrl
- Jenkins base URL to set
-
setAdminAddress
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
instead- Parameters:
adminAddress
- Jenkins administrator mail address to set
-
setSmtpHost
-
setUseSsl
@DataBoundSetter public void setUseSsl(boolean useSsl) -
setUseTls
@DataBoundSetter public void setUseTls(boolean useTls) -
setSmtpPort
-
setCharset
-
setAuthentication
-
getAuthentication
-
setSmtpAuth
Deprecated.as of 1.21 Useauthentication
-
newInstance
public Publisher newInstance(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) throws Descriptor.FormException - Overrides:
newInstance
in classDescriptor<Publisher>
- Throws:
Descriptor.FormException
-
doAddressCheck
-
doCheckSmtpHost
-
doCheckDefaultSuffix
-
doSendTestMail
public FormValidation doSendTestMail(@QueryParameter String smtpHost, @QueryParameter String adminAddress, @QueryParameter boolean authentication, @QueryParameter String username, @QueryParameter Secret password, @QueryParameter boolean useSsl, @QueryParameter boolean useTls, @QueryParameter String smtpPort, @QueryParameter String charset, @QueryParameter String sendTestMailTo) throws IOException Send an email to the admin address- Parameters:
smtpHost
- name of the SMTP server to use for mail sendingadminAddress
- Jenkins administrator mail addressauthentication
- if set totrue
SMTP is used without authentication (username and password)username
- plaintext username for SMTP authenticationpassword
- secret password for SMTP authenticationuseSsl
- if set totrue
SSL is useduseTls
- if set totrue
TLS is usedsmtpPort
- port to use for SMTP transfercharset
- charset of the underlying MIME-mail messagesendTestMailTo
- mail address to send test mail to- Returns:
- response with http status code depending on the result of the mail sending
- Throws:
IOException
- in case the active jenkins instance cannot be retrieved
-
doCheckAuthentication
public FormValidation doCheckAuthentication(@QueryParameter boolean authentication, @QueryParameter boolean useSsl, @QueryParameter boolean useTls) -
isApplicable
- Specified by:
isApplicable
in classBuildStepDescriptor<Publisher>
-
JenkinsLocationConfiguration
instead