• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • email-ext-plugin
    • None
    • Jenkins 2.249.1. Email ext plugin 2.77.
    • 2.78

      To send mail via smtp.office365.com, a correct "from" address is required. If you don't set "from" in the pipleine step, the plugin should use the admin email. The first time the plugin is used, this address is fixed and can't be changed in the UI. 

      I believe the problem is with this code in ExtendedEmailPublisherDescriptor:

       

      public String getAdminAddress() {
              JenkinsLocationConfiguration config = JenkinsLocationConfiguration.get();
              if(config != null) {
                  if(StringUtils.isBlank(mailAccount.getAddress())) {
                      mailAccount.setAddress(config.getAdminAddress());
                  }
              }
              return mailAccount.getAddress();
          }
      
      

      Once an address has been recorded it can never change, even if you change the admin address. In my case it was the "nobody" address.

       

      The address is recorded in Jenkins home directory, file .jenkins/hudson.plugins.emailext.ExtendedEmailPublisher.xml. A viable workaround is to edit the file and correct the address element. Example:

      <address>address not configured yet &lt;nobody@nowhere&gt;</address>
      ->
      <address>correct@adress</address>

      Then restart Jenkins.

          [JENKINS-63846] From address can't be changed

          Gunnar Grim created issue -
          Gunnar Grim made changes -
          Description Original: To send mail via smtp.office365.com, a correct "from" address is required. If you don't set "from" in the pipleine step, the plugin should use the admin email. The first time the plugin is used, this address is fixed and can't be changed in the UI. 

          I believe the problem is with this code in ExtendedEmailPublisherDescriptor:

           
          {code:java}

          public String getAdminAddress() {
                  JenkinsLocationConfiguration config = JenkinsLocationConfiguration.get();
                  if(config != null) {
                      if(StringUtils.isBlank(mailAccount.getAddress())) {
                          mailAccount.setAddress(config.getAdminAddress());
                      }
                  }
                  return mailAccount.getAddress();
              }

          {code}
          Once an address has been recorded it can never change, even if you change the admin address. In my case it was the "nobody" address.

           

          The address is recoded in hudson.plugins.emailext.ExtendedEmailPublisher.xml. A viable workaround is to edit the file:
          {code:java}
          <address>address not configured yet &lt;nobody@nowhere&gt;</address>
          {code}
          Then restart Jenkins.
          New: To send mail via smtp.office365.com, a correct "from" address is required. If you don't set "from" in the pipleine step, the plugin should use the admin email. The first time the plugin is used, this address is fixed and can't be changed in the UI. 

          I believe the problem is with this code in ExtendedEmailPublisherDescriptor:

           
          {code:java}
          public String getAdminAddress() {
                  JenkinsLocationConfiguration config = JenkinsLocationConfiguration.get();
                  if(config != null) {
                      if(StringUtils.isBlank(mailAccount.getAddress())) {
                          mailAccount.setAddress(config.getAdminAddress());
                      }
                  }
                  return mailAccount.getAddress();
              }

          {code}
          Once an address has been recorded it can never change, even if you change the admin address. In my case it was the "nobody" address.

           

          The address is recorded in Jenkins home directory, file .jenkins/hudson.plugins.emailext.ExtendedEmailPublisher.xml. A viable workaround is to edit the file:
          {code:java}
          <address>address not configured yet &lt;nobody@nowhere&gt;</address>
          {code}
          Then restart Jenkins.
          Gunnar Grim made changes -
          Description Original: To send mail via smtp.office365.com, a correct "from" address is required. If you don't set "from" in the pipleine step, the plugin should use the admin email. The first time the plugin is used, this address is fixed and can't be changed in the UI. 

          I believe the problem is with this code in ExtendedEmailPublisherDescriptor:

           
          {code:java}
          public String getAdminAddress() {
                  JenkinsLocationConfiguration config = JenkinsLocationConfiguration.get();
                  if(config != null) {
                      if(StringUtils.isBlank(mailAccount.getAddress())) {
                          mailAccount.setAddress(config.getAdminAddress());
                      }
                  }
                  return mailAccount.getAddress();
              }

          {code}
          Once an address has been recorded it can never change, even if you change the admin address. In my case it was the "nobody" address.

           

          The address is recorded in Jenkins home directory, file .jenkins/hudson.plugins.emailext.ExtendedEmailPublisher.xml. A viable workaround is to edit the file:
          {code:java}
          <address>address not configured yet &lt;nobody@nowhere&gt;</address>
          {code}
          Then restart Jenkins.
          New: To send mail via smtp.office365.com, a correct "from" address is required. If you don't set "from" in the pipleine step, the plugin should use the admin email. The first time the plugin is used, this address is fixed and can't be changed in the UI. 

          I believe the problem is with this code in ExtendedEmailPublisherDescriptor:

           
          {code:java}
          public String getAdminAddress() {
                  JenkinsLocationConfiguration config = JenkinsLocationConfiguration.get();
                  if(config != null) {
                      if(StringUtils.isBlank(mailAccount.getAddress())) {
                          mailAccount.setAddress(config.getAdminAddress());
                      }
                  }
                  return mailAccount.getAddress();
              }

          {code}
          Once an address has been recorded it can never change, even if you change the admin address. In my case it was the "nobody" address.

           

          The address is recorded in Jenkins home directory, file .jenkins/hudson.plugins.emailext.ExtendedEmailPublisher.xml. A viable workaround is to edit the file and correct the address element. Example:
          {code:java}
          <address>address not configured yet &lt;nobody@nowhere&gt;</address>
          ->
          <address>correct@adress</address>{code}
          Then restart Jenkins.
          Pavan Indukuri made changes -
          Link New: This issue is related to JENKINS-63890 [ JENKINS-63890 ]

          Alex Earl added a comment -

          The admin email comes from the Jenkins Location area of the Global Configuration if it exists. Are you saying you can't change it in that field in the Global Configuration?

          Alex Earl added a comment - The admin email comes from the Jenkins Location area of the Global Configuration if it exists. Are you saying you can't change it in that field in the Global Configuration?

          Dave Fox added a comment - - edited

          Changing the email address in that location through the web UI doesn't work, that's the core issue here. It will look like it worked, as the display will save and update if you go out and back into the Global Configuration, but it won't change when the system sends out emails.

          It used to work until one of the recent plug-in updates, as in our workflow we change this from address about every three weeks or so. To get around this for now, I've had to manually edit the file jenkins.model.JenkinsLocationConfiguration.xml on the Controller, as Gunnar has noted in this ticket's Description.

          Dave Fox added a comment - - edited Changing the email address in that location through the web UI doesn't work, that's the core issue here. It will look like it worked, as the display will save and update if you go out and back into the Global Configuration, but it won't change when the system sends out emails. It used to work until one of the recent plug-in updates, as in our workflow we change this from address about every three weeks or so. To get around this for now, I've had to manually edit the file jenkins.model.JenkinsLocationConfiguration.xml on the Controller, as Gunnar has noted in this ticket's Description.

          Alex Earl added a comment -

          Ok, I'll take a look.

          Alex Earl added a comment - Ok, I'll take a look.
          Alex Earl made changes -
          Assignee Original: Alex Earl [ slide_o_mix ]

          Tim Jacomb added a comment -

          fyi basil

          Tim Jacomb added a comment - fyi basil
          Basil Crow made changes -
          Assignee New: Basil Crow [ basil ]

            basil Basil Crow
            gugrim Gunnar Grim
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: