Class SMTPUtil

java.lang.Object
org.keycloak.utils.SMTPUtil

public class SMTPUtil extends Object
SMTP utility methods.
Author:
rmartinc
  • Method Details

    • checkSMTPConfiguration

      public static void checkSMTPConfiguration(KeycloakSession session, Map<String,String> config) throws EmailException
      Validates the configuration using the email sender provider.
      Parameters:
      session - The keycloak session to use
      config - The configuration to validate
      Throws:
      EmailException - If some error is found in the configuration
    • convertIDNEmailAddress

      public static String convertIDNEmailAddress(String email)
      Converts an email address to its ASCII representation using punycode (IDN.toASCII) for the domain part. The local part is not modified.
      Parameters:
      email - The email to convert
      Returns:
      The converted email or null (if IDN.toASCII throws an exception)