Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP server config in Email-Ext seems to be loaded, but disappears #772

Closed
przecze opened this issue Mar 6, 2019 · 4 comments

Comments

@przecze
Copy link

commented Mar 6, 2019

  • [2.150.2 ] Jenkins version
  • [1.7 ] Plugin version
  • [Debian GNU/Linux 9 (stretch) ] OS

Steps to reproduce:

  • Use the following config file:
    plugins.yaml:
unclassified:
  extendedEmailPublisher:
    smtpServer: "smtp.something.something.net"
  • And the following Dockerfile:
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"
  • Build the image and run with default entrypoint and -p 8080:8080
  • Wait for Jenkins is fully up and running...
  • Open
  • smtp.something.something.net is visible in Extended E-mail Notification/SMTP server
  • click "Save"
  • open http://localhost:8080/configure again
  • value in Extended E-mail Notification/SMTP server disappeared!

But 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.

@przecze

This comment has been minimized.

Copy link
Author

commented Mar 6, 2019

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.

@riansanderson riansanderson referenced this issue Apr 28, 2019
1 of 1 task complete
@timja

This comment has been minimized.

Copy link
Member

commented Apr 28, 2019

This isn't a JCasc bug, it's an issue with one of the mailer plugins

@oleg-nenashev

This comment has been minimized.

Copy link
Member

commented May 27, 2019

@przecze Is there a Jenkins JIRA issue for it? The most of plugins are maintained there, and its maintainers won;t see this issue

@stale

This comment has been minimized.

Copy link

commented Aug 25, 2019

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.

@stale stale bot added the stale label Aug 25, 2019

@stale stale bot closed this Sep 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.