Package hudson.tasks

Class Mailer.DescriptorImpl

All Implemented Interfaces:
Saveable, Loadable, OnMaster
Enclosing class:
Mailer

@Extension public static final class Mailer.DescriptorImpl extends BuildStepDescriptor<Publisher>
  • Constructor Details

    • DescriptorImpl

      public DescriptorImpl()
  • Method Details

    • getRequiredGlobalConfigPagePermission

      @NonNull public Permission getRequiredGlobalConfigPagePermission()
      Overrides:
      getRequiredGlobalConfigPagePermission in class Descriptor<Publisher>
    • getDisplayName

      public String getDisplayName()
      Overrides:
      getDisplayName in class Descriptor<Publisher>
    • getDefaultSuffix

      public String getDefaultSuffix()
    • getReplyToAddress

      public String getReplyToAddress()
    • setReplyToAddress

      @DataBoundSetter public void setReplyToAddress(String address)
    • 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 class Descriptor<Publisher>
      Throws:
      Descriptor.FormException
    • getSmtpHost

      public String getSmtpHost()
    • getSmtpServer

      @Deprecated public String getSmtpServer()
      Deprecated.
      as of 1.23, use getSmtpHost()
    • getAdminAddress

      @Deprecated public String getAdminAddress()
      Deprecated.
      as of 1.4 Use JenkinsLocationConfiguration instead
      Returns:
      administrator mail address
    • getUrl

      @Deprecated public String getUrl()
      Deprecated.
      as of 1.4 Use JenkinsLocationConfiguration instead
      Returns:
      Jenkins base URL
    • getSmtpAuthUserName

      @Deprecated public String getSmtpAuthUserName()
      Deprecated.
      as of 1.21 Use authentication
    • getSmtpAuthPassword

      @Deprecated public String getSmtpAuthPassword()
      Deprecated.
      as of 1.21 Use authentication
    • getSmtpAuthPasswordSecret

      public Secret getSmtpAuthPasswordSecret()
    • getUseSsl

      public boolean getUseSsl()
    • getUseTls

      public boolean getUseTls()
    • getSmtpPort

      public String getSmtpPort()
    • getCharset

      public String getCharset()
    • setDefaultSuffix

      @DataBoundSetter public void setDefaultSuffix(String defaultSuffix)
    • setHudsonUrl

      @Deprecated public void setHudsonUrl(String hudsonUrl)
      Deprecated.
      as of 1.4 Use JenkinsLocationConfiguration instead
      Parameters:
      hudsonUrl - Jenkins base URL to set
    • setAdminAddress

      @Deprecated public void setAdminAddress(String adminAddress)
      Deprecated.
      as of 1.4 Use JenkinsLocationConfiguration instead
      Parameters:
      adminAddress - Jenkins administrator mail address to set
    • setSmtpHost

      @DataBoundSetter public void setSmtpHost(String smtpHost)
    • setUseSsl

      @DataBoundSetter public void setUseSsl(boolean useSsl)
    • setUseTls

      @DataBoundSetter public void setUseTls(boolean useTls)
    • setSmtpPort

      @DataBoundSetter public void setSmtpPort(String smtpPort)
    • setCharset

      @DataBoundSetter public void setCharset(String charset)
    • setAuthentication

      @DataBoundSetter public void setAuthentication(@CheckForNull SMTPAuthentication authentication)
    • getAuthentication

      @CheckForNull public SMTPAuthentication getAuthentication()
    • setSmtpAuth

      @Deprecated public void setSmtpAuth(String userName, String password)
      Deprecated.
      as of 1.21 Use authentication
    • newInstance

      public Publisher newInstance(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) throws Descriptor.FormException
      Overrides:
      newInstance in class Descriptor<Publisher>
      Throws:
      Descriptor.FormException
    • doAddressCheck

      public FormValidation doAddressCheck(@QueryParameter String value)
    • doCheckSmtpHost

      public FormValidation doCheckSmtpHost(@QueryParameter String value)
    • doCheckDefaultSuffix

      public FormValidation doCheckDefaultSuffix(@QueryParameter String value)
    • 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 sending
      adminAddress - Jenkins administrator mail address
      authentication - if set to true SMTP is used without authentication (username and password)
      username - plaintext username for SMTP authentication
      password - secret password for SMTP authentication
      useSsl - if set to true SSL is used
      useTls - if set to true TLS is used
      smtpPort - port to use for SMTP transfer
      charset - charset of the underlying MIME-mail message
      sendTestMailTo - 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

      public boolean isApplicable(Class<? extends AbstractProject> jobType)
      Specified by:
      isApplicable in class BuildStepDescriptor<Publisher>