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

createFailureMail creates wrong URL by appending lots of "-", because of missing append("\n\n") after refactoring in 1.18

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: mailer-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2012 R2
      JDK 1.8.0_92
      Jenkins 2.7.4
      Tomcat 8.5.4
      mailer-plugin 1.18
    • Similar Issues:

      Description

      When using the new 1.18 mailer-plugin on a job which doesn't provide changesets as it e.g. only executes a batch file the resulting mail (e.g. in case of failure) contains in the first line of its content a malformed link.
      Previous to version 1.18 the first 4 lines looked like this:
      See <http://jenkinsserver:8080/job/Fail_Build_On_Purpose/9/>

      ------------------------------------------
      Started by user John Doe
      ...
      Starting from version 1.18 the first 2 (two) look like this:
      http://s-hqbuildmaster1:9080/job/Fail_Build_On_Purpose/7/------------------------------------------
      Started by user John Doe
      ...

      Not only looks it different (missing "See " and "<"...">") but the resulting URL contains many "-" symbols at the end. This causes email clients like Outlook to generate wrong links.

      I took a look into the code and have seen, that there was some refactoring done on September the first (https://github.com/jenkinsci/mailer-plugin/commit/432d3cf716337c361208b826770c19556eed4bf9#diff-93012b4845d2e1fb704486d5ce09c174).

      The relevant file is the following: src/main/java/hudson/tasks/MailSender.java

      Before that refactoring a "\n\n" was appended to the URL (append("\n\n") in line 258 in the old file). That new line is now missing. If I see it correctly adding a .append("\n\n") in the current version in line 252 should solve this URL-issue.

        Attachments

          Issue Links

            Activity

            Hide
            gerpu Paul Schubert added a comment -

            This issue has been reported 3 month later a second time in issue 40224 and there been solved

            Show
            gerpu Paul Schubert added a comment - This issue has been reported 3 month later a second time in issue 40224 and there been solved

              People

              • Assignee:
                Unassigned
                Reporter:
                gerpu Paul Schubert
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: