Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-39070

JIRA from address in outbound email changed to 'localhost' if you use Java 8

      If you use Java 8 to run JIRA 6.3 you can find that your outbound email addresses will be of the form jwinters@localhost rather than jwinters@atlassian.com

      Diagnosis

      In Java 8, getLocalHost().getHostName() behaves differently from previous Java versions depending on the order of aliases in /etc/hosts.

      Workaround

      Changing the order of domain aliases in /etc/hosts to changes the return value of getHostName() in Java 8.

      For example,

      • If /etc/hosts is 127.0.0.1 localhost localhost.localdomain centos57, then Java8 returns localhost for getHostName().
      • If we rewrite this as 127.0.0.1 centos57 localhost.localdomain localhost then getHostName() returns centos57.

            [JRASERVER-39070] JIRA from address in outbound email changed to 'localhost' if you use Java 8

            assigning to myself as the fix for this will come as part of HIROL-109

            mjh (Inactive) added a comment - assigning to myself as the fix for this will come as part of HIROL-109

            This appears to be a change in the way that Java 8 does host resolutioin and appears to be caused by the ordering of localhost aliases in the /etc/hosts file

            So if your hosts entry is

            127.0.0.1 localhost localhost.domain myhostname

            then the results of InetAddress.getLocalHost().getHostName() will return localhost

            If you edit the /etc/hosts file to

            127.0.0.1 myhostname localhost.domain localhost

            then Java correctly returns myhostname

            tier-0 grump added a comment - This appears to be a change in the way that Java 8 does host resolutioin and appears to be caused by the ordering of localhost aliases in the /etc/hosts file So if your hosts entry is 127.0.0.1 localhost localhost.domain myhostname then the results of InetAddress.getLocalHost().getHostName() will return localhost If you edit the /etc/hosts file to 127.0.0.1 myhostname localhost.domain localhost then Java correctly returns myhostname

              mharrison mjh (Inactive)
              jwinters tier-0 grump
              Affected customers:
              6 This affects my team
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: