Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-6685

Set local hostname from request in JavaMail configuration

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Out of Date
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      Currently the configuration of JavaMail options is quite limited,
      e.g. special options like mail.smtp.localhost cannot be set and
      require a custom EmailSenderProvider.

      It would be great if one could configure arbitrary JavaMail properties globally
      and on realm level.

      See the full list of JavaMail Properties here:
      https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html

      Concrete usecase is many SMTP servers on the Internet require a fully
      qualified domain name in the HELO/EHLO command for SMTP.

      Currently Keycloak/JavaMail tries to get the fully qualified domain name from your operating system.
      However, often the OS only returns the current host name rather than FQDN, e.g. in some private cloud environments.

      In such cases the SMTP auth failes and thus does not allow to send emails.
      A workaround is to whitelist the IP addresses of the keycloak server(s) on the Mail Server but it
      would be better to be able to configure Keycloak properly, e.g. by setting the
      JavaMail property mail.smtp.localhost to something like mail.mycompany.com.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  tdarimont Thomas Darimont
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: