I think there may still be an issue here. The problem I have happens when I add smtpUsername / smtpPassword configuration fields, to authenticate with an SMTP server. This can be set up 'hands on' in the UI, so using the necessary fields described in the JCasC 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 If anyone stumbles across this page and needs to get SMTP authentication working for the Email Extension plugin, I was able to using 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! (mailer plugin does not support SMTP auth fields - JENKINS-55109) See also: https://github.com/jenkinsci/configuration-as-code-plugin/issues/772 |