Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62832

email-ext : email addresses with dash are truncated

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: email-ext-plugin
    • Labels:
    • Environment:
      Red Hat Enterprise Linux Server release 7.8 (Maipo) 64b
      OpenJDK 1.8.0_252-b09
      Jenkins 2.222.3
      email-ext plugin 2.69
    • Similar Issues:

      Description

      When a developer email address contains a dash (ex: compound name), the email address part between dash and @ is truncated. Then, the developer did not receive mail.

      Example: john.doe-die@domain.com is truncated to john.doe@domain.com

      We are calling plugin from a declarative pipeline with this code: 

      post {
        emailext recipientProviders: [
            [$class: 'RequesterRecipientProvider'],
            [$class: 'DevelopersRecipientProvider']
          ],
          subject: '$DEFAULT_SUBJECT',
          body: '$DEFAULT_CONTENT',
          attachLog: true,
          compressLog: true
      }

       

       

        Attachments

          Activity

          Hide
          slide_o_mix Alex Earl added a comment -

          email-ext uses the Mailer.Userproperty class to get the configured email for the user (https://github.com/jenkinsci/email-ext-plugin/blob/960cb17bbca6f6261cba407ac92842296a9a1be6/src/main/java/hudson/plugins/emailext/EmailRecipientUtils.java#L109), these users can be created by the SCM when requested to get the list of changes. The Mailer.Userproperty will use a MailAddressResolver internally to get the email address for the user. There are various different implementations of MailAddressResolver (one of which is in the Active Directory plugin), but the first one that responds will be the email address that is used. Is this happening for all users, or for one user? What plugins do you have installed?

          Show
          slide_o_mix Alex Earl added a comment - email-ext uses the Mailer.Userproperty class to get the configured email for the user ( https://github.com/jenkinsci/email-ext-plugin/blob/960cb17bbca6f6261cba407ac92842296a9a1be6/src/main/java/hudson/plugins/emailext/EmailRecipientUtils.java#L109 ), these users can be created by the SCM when requested to get the list of changes. The Mailer.Userproperty will use a MailAddressResolver internally to get the email address for the user. There are various different implementations of MailAddressResolver (one of which is in the Active Directory plugin), but the first one that responds will be the email address that is used. Is this happening for all users, or for one user? What plugins do you have installed?
          Hide
          jroyer Joël Royer added a comment -

          It happens with only one user.

          The plugin for active directory is active-directory 2.16 (https://plugins.jenkins.io/active-directory/).

           

          Show
          jroyer Joël Royer added a comment - It happens with only one user. The plugin for active directory is active-directory 2.16 ( https://plugins.jenkins.io/active-directory/ ).  
          Hide
          jroyer Joël Royer added a comment -

          I've check user account in AD.

          His email address is well john.doe-die@domain.com but it is not set in an "mail" field. Could it be the reason ?

          Show
          jroyer Joël Royer added a comment - I've check user account in AD. His email address is well john.doe-die@domain.com  but it is not set in an "mail" field. Could it be the reason ?
          Hide
          slide_o_mix Alex Earl added a comment -

          If the user property is not set for that user, then the MailAddressResolver stuff will come into play and some MailAddressResolvers will just append the username they see from the commit with the domain name and return. If you set it in the email field for that user, that value will be used directly.

          Show
          slide_o_mix Alex Earl added a comment - If the user property is not set for that user, then the MailAddressResolver stuff will come into play and some MailAddressResolvers will just append the username they see from the commit with the domain name and return. If you set it in the email field for that user, that value will be used directly.
          Hide
          jroyer Joël Royer added a comment - - edited

          I've got news.

          The email-ext plugin is not the cause. We have a cache problem in the "People" section of Jenkins.

          Sorry for false alert.

          Show
          jroyer Joël Royer added a comment - - edited I've got news. The email-ext plugin is not the cause. We have a cache problem in the "People" section of Jenkins. Sorry for false alert.

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              jroyer Joël Royer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: