[JIRA] (JENKINS-58570) smtpHost ignored when CasC attempts to set smtpUsername / smtpPassword

6 views
Skip to first unread message

robin.smith@forgerock.com (JIRA)

unread,
Jul 19, 2019, 5:45:03 AM7/19/19
to jenkinsc...@googlegroups.com
Robin Smith created an issue
 
Jenkins / Bug JENKINS-58570
smtpHost ignored when CasC attempts to set smtpUsername / smtpPassword
Issue Type: Bug Bug
Assignee: Alex Earl
Components: email-ext-plugin
Created: 2019-07-19 09:44
Environment: Jenkins lts version 2.164.3
email-ext 2.66
configuration-as-code:1.15
configuration-as-code-support:1.15
Labels: jcasc-compatibility
Priority: Minor Minor
Reporter: Robin Smith

Configuring the email-ext plugin using the CasC plugin, the smtpHost is ignored when also setting the smtpUsername / smtpPassword authentication fields.

The Email Extension plugin can be set up 'hands on' in the UI, so using the necessary fields described in the CasC documentation, I set up something like this:

  extendedEmailPublisher: 
    smtpServer: smtp.server.com
    smtpUsername: ale...@company.com
    smtpPassword: ${SMTPpass}
    useSsl: true
    charset: UTF-8
    defaultContentType: text/plain
    defaultSubject: "Build $BUILD_NUMBER - $BUILD_STATUS"
    defaultBody: "Check console output at $BUILD_URL"

But adding the smtpUsername / smtpPassword fields seems to cause the 'smtpServer' value to be ignored completely (it's not ignored when the smtpUsername / smtpPassword fields are not present). Instead, the 'smtpHost' value from the Mailer plugin configuration is used in its place

In order to get SMTP authentication working for the Email Extension plugin, I used this setup:

  mailer: 
    smtpHost: smtp.server.com
    useSsl: true
    charset: UTF-8
  extendedEmailPublisher: 
    smtpUsername: ale...@company.com
    smtpPassword: ${SMTPpass}
    defaultContentType: text/plain
    defaultSubject: "Build $BUILD_NUMBER - $BUILD_STATUS"
    defaultBody: "Check console output at $BUILD_URL"

It's not ideal that part of the configuration lives in each plugin though (the mailer plugin does not support SMTP auth fields - JENKINS-55109)

See also: https://github.com/jenkinsci/configuration-as-code-plugin/issues/772

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

slide.o.mix@gmail.com (JIRA)

unread,
Feb 21, 2020, 2:00:04 PM2/21/20
to jenkinsc...@googlegroups.com
Alex Earl commented on Bug JENKINS-58570
 
Re: smtpHost ignored when CasC attempts to set smtpUsername / smtpPassword

You could try adding a field like this:

 

extendedEmailPublisher:
  overrideGlobalSettings: true
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

timjacomb1@gmail.com (JIRA)

unread,
Mar 7, 2020, 5:43:03 AM3/7/20
to jenkinsc...@googlegroups.com

Auth works in the mailer plugin as of https://issues.jenkins-ci.org/browse/JENKINS-55109

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages