Steps to reproduce:
unclassified:
extendedEmailPublisher:
smtpServer: "smtp.something.something.net"
FROM jenkins/jenkins:lts
USER jenkins
COPY plugins.yaml /usr/share/jenkins/ref/casc_configs/
ENV CASC_JENKINS_CONFIG /usr/share/jenkins/ref/casc_configs
# Install plugins
RUN /usr/local/bin/install-plugins.sh configuration-as-code configuration-as-code-support email-ext
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false"
-p 8080:8080Jenkins is fully up and running...smtp.something.something.net is visible in Extended E-mail Notification/SMTP serverBut it seems to be something with this value even before you open _/configure_ for the first time and click "Save", because sending email after failed job fails at the connection.
Ok, I investigated it further. It seems issue disappears when smtp settings are duplicated in mailer:
plugins.yaml:
unclassified:
mailer:
smtpHost: "smtp.something.something.net"
extendedEmailPublisher:
smtpServer: "smtp.something.something.net"
Now in configuration page, smtp.something.something.net is visible both in Extended E-mail Notification/SMTP server and E-mail Notification/SMTP server. And both persist after pressing "Save". And email notifications work as expected.
Interestingly, notifications seem to work even when smtp server name and port is provided only in mailer. So all that you need is:
unclassified:
mailer:
smtpHost: "smtp.something.something.net"
smtpPort: "25"
extendedEmailPublisher:
smtpUsername: "blahblah"
smtpPassword: "${SMTP_PASSWORD}"
But that's more of an issue of the plugin itself, not JCasC.
Anyway, although it can be worked around, the issue on JCasC side remains: setting value of extendedEmailPublisher/smtpHost in .yaml doesn't have the same effect as setting it in UI.
This isn't a JCasc bug, it's an issue with one of the mailer plugins
@przecze Is there a Jenkins JIRA issue for it? The most of plugins are maintained there, and its maintainers won;t see this issue
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Ok, I investigated it further. It seems issue disappears when smtp settings are duplicated in mailer:
plugins.yaml:
Now in configuration page,
smtp.something.something.netis visible both in Extended E-mail Notification/SMTP server and E-mail Notification/SMTP server. And both persist after pressing "Save". And email notifications work as expected.Interestingly, notifications seem to work even when smtp server name and port is provided only in
mailer. So all that you need is:But that's more of an issue of the plugin itself, not JCasC.
Anyway, although it can be worked around, the issue on JCasC side remains: setting value of
extendedEmailPublisher/smtpHostin .yaml doesn't have the same effect as setting it in UI.