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

email-ext : email addresses with dash are truncated

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • email-ext-plugin
    • 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

      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
      }

       

       

          [JENKINS-62832] email-ext : email addresses with dash are truncated

          Joël Royer created issue -
          Joël Royer made changes -
          Description Original: When a developer email address contains a dash (ex: compound name), the address is truncated before dash.

          Example: [john.doe-die@domain.com|mailto:john.doe-die@domain.com] is truncated to [john.doe@domain.com|mailto:john.doe@domain.com]

           
          New: When a developer email address contains a dash (ex: compound name), the email address part between dash and @ is truncated.

          Example: [john.doe-die@domain.com|mailto:john.doe-die@domain.com] is truncated to [john.doe@domain.com|mailto:john.doe@domain.com]

           
          Joël Royer made changes -
          Description Original: When a developer email address contains a dash (ex: compound name), the email address part between dash and @ is truncated.

          Example: [john.doe-die@domain.com|mailto:john.doe-die@domain.com] is truncated to [john.doe@domain.com|mailto:john.doe@domain.com]

           
          New: 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|mailto:john.doe-die@domain.com] is truncated to [john.doe@domain.com|mailto:john.doe@domain.com]

           
          Joël Royer made changes -
          Labels New: plugins

          Alex Earl added a comment -

          I'm not able to reproduce this in tests. Can you enable debug mode in the global config for email-ext and then provide a build log?

          Alex Earl added a comment - I'm not able to reproduce this in tests. Can you enable debug mode in the global config for email-ext and then provide a build log?

          Joël Royer added a comment - - edited

          I will do it soon and I will be back with a build log.

          I've just add to the description the code we use in our pipeline.

          Joël Royer added a comment - - edited I will do it soon and I will be back with a build log. I've just add to the description the code we use in our pipeline.
          Joël Royer made changes -
          Description Original: 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|mailto:john.doe-die@domain.com] is truncated to [john.doe@domain.com|mailto:john.doe@domain.com]

           
          New: 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|mailto:john.doe-die@domain.com] is truncated to [john.doe@domain.com|mailto:john.doe@domain.com]

          We are calling plugin from a declarative pipeline with this code: 
          {code:java}
          post {
            emailext recipientProviders: [
                [$class: 'RequesterRecipientProvider'],
                [$class: 'DevelopersRecipientProvider']
              ],
              subject: '$DEFAULT_SUBJECT',
              body: '$DEFAULT_CONTENT',
              attachLog: true,
              compressLog: true
          }{code}
           

           

          Joël Royer added a comment -

          Here is the log:

          [Pipeline] emailext
          messageContentType = text/html; charset=UTF-8
          Request made to attach build log
          Request made to compress build log
          Adding recipients from project recipient list
            Collecting change authors...
              build: 2
                adding author: DOE John
          Adding DOE John with address john.doe@domain.com
          Analyzing: john.doe@domain.com
          Looking for: john.doe@domain.com
          	starting at: 0
          	firstFoundIdx: 0
          	firstFoundIdx-substring: john.doe@domain.com
          	=> found type: 0
          Analyzing: john.doe@domain.com
          Looking for: john.doe@domain.com
          	starting at: 0
          	firstFoundIdx: 0
          	firstFoundIdx-substring: john.doe@domain.com
          	=> found type: 0
          Analyzing: john.doe@domain.com
          Looking for: john.doe@domain.com
          	starting at: 0
          	firstFoundIdx: 0
          	firstFoundIdx-substring: john.doe@domain.com
          	=> found type: 0
          Adding recipients from trigger recipient list
          Successfully created MimeMessage

          Joël Royer added a comment - Here is the log: [Pipeline] emailext messageContentType = text/html; charset=UTF-8 Request made to attach build log Request made to compress build log Adding recipients from project recipient list Collecting change authors... build: 2 adding author: DOE John Adding DOE John with address john.doe@domain.com Analyzing: john.doe@domain.com Looking for: john.doe@domain.com starting at: 0 firstFoundIdx: 0 firstFoundIdx-substring: john.doe@domain.com => found type: 0 Analyzing: john.doe@domain.com Looking for: john.doe@domain.com starting at: 0 firstFoundIdx: 0 firstFoundIdx-substring: john.doe@domain.com => found type: 0 Analyzing: john.doe@domain.com Looking for: john.doe@domain.com starting at: 0 firstFoundIdx: 0 firstFoundIdx-substring: john.doe@domain.com => found type: 0 Adding recipients from trigger recipient list Successfully created MimeMessage

          Joël Royer added a comment - - edited

          For information, we use an active directory for authentification.

          If the email address is read from AD, can you tell me which field is used?

          Joël Royer added a comment - - edited For information, we use an active directory for authentification. If the email address is read from AD, can you tell me which field is used?

          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?

          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?

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

              Created:
              Updated:
              Resolved: