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

pipeline build failed mail - missing line break

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • mailer-plugin
    • jenkins 2.19.3
      Mailer plugin 1.18
    • 1.26

      when catching a build failure and sending an email via:

      catch (err) {
          node ('Client-Slave'){
              echo "Failed: ${err}"
              currentBuild.result = 'FAILURE'
              step([$class: 'Mailer', recipients: 'example@example.com, recipient2@example.com'])
          }
      }
      

      the mail is send as:

      [...]
      X-Jenkins-Job: example_pipeline
      X-Jenkins-Result: FAILURE
      
      https://jenkins.example.com/blue/organizations/jenkins/example_pipeline/detail/example_pipeline/21/------------------------------------------
      [...truncated 25 lines...]
      [...]
      

      it would be better to send it with a line break after the url, as the ----- are treated as part of the url by some mail clients:

      [...]
      X-Jenkins-Job: example_pipeline
      X-Jenkins-Result: FAILURE
      
      https://jenkins.example.com/blue/organizations/jenkins/example_pipeline/detail/example_pipeline/21/
      ------------------------------------------
      [...truncated 25 lines...]
      [...]
      

            Unassigned Unassigned
            romanp Roman Pickl
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: